python - No attribute error when resampling -
i have dataframe
date count 0 2012-03-23 2 1 2012-03-25 1 2 2012-03-26 1 3 2012-03-27 1 4 2012-03-28 3 5 2012-04-05 2 6 2012-04-06 1 7 2012-04-08 2 8 2012-04-10 1 9 2012-04-11 1
i trying daterange date column using
df.set_index('date').resample('d').fillna(0).reset_index()
but results in
attributeerror: 'int' object has no attribute 'lower'
even though date column no strings in it.
any idea casuing error?
future warning says resample deferred method.
you pieced solution already.
df.set_index('date').resample('d').mean().fillna(0).reset_index()
Comments
Post a Comment