본문 바로가기
반응형

연구 노트151

자동으로 날짜 생성 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.
NCO Times 바꾸기 [chpark@adis00 em_real]$ ncdump -v Times in.nc netcdf out { dimensions: Time = 1 ; DateStrLen = 19 ; emissions_zdim = 1 ; south_north = 319 ; west_east = 431 ; variables: char Times(Time, DateStrLen) ; Times:Times\:_FillValue = " " ; float E_CO2(Time, emissions_zdim, south_north, west_east) ; E_CO2:coordinates = "XLONG XLAT" ; E_CO2:stagger = " " ; E_CO2:units = "mol km^-2 hr^-1" ; E_CO2:descrip.. 2022. 1. 25.
728x90