Python Dataframe.resample() deletes time from datetimeindex

Viewed 189

For some reason, resampling to 24H or 1D chops time from DateTimeIndex.

i'm using
python: 3.5.3 / conda
numpy: 1.11.3
pandas: 0.20.2

df = pd.read_csv(inFile, parse_dates=True)

print(df.head())
df = df.resample("1D").agg({'open':'first','high':'max','low' :'min','close': 'last','volume': 'sum'}).dropna()

print(df.head()

First print statement

enter image description here

Second

enter image description here

1 Answers
Related