df_volume=df['Volume'].resample('10D').sum()TypeError: Only valid with DatetimeIndex, TimedeltaIndex or PeriodIndex, but got an instance of 'Int64Index'
如何在pandas中获取分组窗口?答:失败,出现以下错误:
TypeError: Only valid with DatetimeIndex, TimedeltaIndex如何按时间保存窗口?df = pd.DataFrame({'value': range(60), 'group': [random.choice(groups) for i in ran
train = df.loc[:-10 , ['priceUsd']]
test = df.loc[-10: , ['priceUsd']] 当我运行这段代码时,它显示错误 TypeError: cannotdo slice indexing on DatetimeIndex with these indexers [-10] of type int 如何修复它?
我有一个带有两级MultiIndex的MultiIndex.第一级date是一个DatetimeIndex,第二级name只是一些字符串。数据有10分钟的间隔。如何在此MultiIndex的第一级按日期分组并计算每天的行数?我怀疑DatetimeIndex耦合到MultiIndex会给我带来问题,因为给我
TypeError:Only valid with DatetimeIndex, Ti