본문 바로가기
반응형

연구 노트/R Python76

자동으로 날짜 생성 https://hyunmin1906.tistory.com/26 [Pandas] 판다스 날짜 자동 생성(date_range()) ■ 날짜 자동 생성 ※ freq 옵션 약어 설명 사용 예 D 달력 날짜 기준 하루 주기 하루 주기: freq = 'D', 이틀 주기: freq = '2D' B 업무 날짜 기준 하루 주기 업무일(월~금) 기준으로 생성, freq = 'B', freq =.. hyunmin1906.tistory.com 2022. 3. 11.
df 날짜별로 구분해서 출력하는 법 filtered_df = df[df["Date"].isin(pd.date_range('2020-08-25', '2020-08-27'))] ## 날짜별로 구분해서 출력 print(filtered_df) 2022. 3. 11.
날짜 형식 변환 # dasos['Date'] = pd.to_datetime(dasos['Date'], format='%Y-%m-%d %H:%M:%S') # dasos.head() 2022. 3. 11.
인덱스 추출법 # ind_sub = df['NO2'].loc[(df['Date'] >= '2019-11-13 16:00:00') & (df['Date'] 2022. 3. 11.
같은 값을 가지는 행들끼리 이어붙이기 (링크) https://mindscale.kr/course/pandas-basic/merge/ 같은 값을 가지는 행들끼리 이어붙이기 mindscale.kr 2022. 2. 16.
datetime 변환 오류 24:00를 00:00 으로 바꿔야 ... 에러: 24:00 로 시간이 표시되면 에러 발생 23:00 로 바꾸고, 날짜 바꾸고 월, 년 다 바꿔야 함. 아래 와 같이 해결 코드: from datetime import timedelta import pandas as pd df['datetime_zero'] = df['Datetime'].str.replace('24:00', '00:00') df['datetime_er'] = pd.to_datetime(df['datetime_zero'], format='%Y-%m-%d %H:%M:%S') selrow = df['Datetime'].str.contains('24:00') df['datetime_obj'] = df['datetime_er'] + selrow * timedelta(days=1) https:.. 2022. 2. 15.
파이썬 문자열 처리를 위한 다양한 메소드 (Python string methods) (링크) https://yganalyst.github.io/data_handling/memo_9/ [Python] pandas 문자열 관련 함수 str 판다스의 str 연산자를 이용해 문자열을 다루는 방법 yganalyst.github.io 2022. 2. 14.
[링크] 태양광 계산법 (이론) 태양광 계산법 https://earthscience.stackexchange.com/questions/14491/how-to-calculate-the-solar-radiation-at-any-place-any-time How to calculate the solar radiation at any place, any time The solar radiation is one of the important factors controlling the formation of $O_3$, and thereby impacting the levels of various secondary species in the atmosphere. However, in the campaign of earthscience.stacke.. 2022. 2. 4.
연속 열 누락 데이터 처리 방법 및 구현 https://ichi.pro/ko/yeonsog-yeol-nulag-deiteo-cheoli-bangbeob-mich-guhyeon-78086618663363 연속 열 누락 데이터 처리 방법 및 구현 지난 블로그 링크에서 누락 된 값과 그 유형에 대해 설명했습니다. 이 블로그에서는 구현을 통해 데이터 세트의 연속 데이터 열에 대한 누락 된 값을 처리하는 방법을 설명합니다. ichi.pro 2022. 1. 21.
728x90