0

I tried to export a DatetimeIndexResampler with the dataframe.to_csv("name.csv") method but it doesn't work with this kind of data. Here's the code i'm having difficulties with:

data_perc = data.copy().pct_change().dropna() * 100
data_1 = data_perc["Close"].resample("A")
data_1.to_csv("Pct_change.csv")

I get the error: "'DatetimeIndexResampler' object has no attribute 'to_csv'", but i don't know what method i should use instead of df.to_csv.

cappez
  • 1
  • 1
  • see: [How to convert DatetimeIndexResampler to DataFrame?](https://stackoverflow.com/questions/39492004/how-to-convert-datetimeindexresampler-to-dataframe), then export to csv. – FObersteiner Mar 23 '22 at 00:54

0 Answers0