import pyupbit
market_price = pyupbit.get_ohlcv("KRW-ETH", interval="minute1")
print(market_price.resample('2T'))
-------------------------------------------------------------------------------------
DatetimeIndexResampler [freq=<2 * Minutes>, axis=0, closed=left, label=left, convention=start, origin=start_day]
에러가 나서, 찾아보니까
Starting from 0.18.0, resample itself is a deferred operation, meaning that you first have to call a method (in this case mean()) to perform the actual resampling:
판다스 버전이 높아서 난 에러인것 같습니다.
import pandas as pd
print( pd. __version__ )
------------------------------------
1.1.3
market_price.resample('2T').mean() 로 수정하니까 정상 출력이 됩니다.
참고하세요~
https://stackoverflow.com/questions/37723906/pandas-resample-does-not-work-properly