weather = pd.read_csv('data/C2A2_data/BinnedCsvs_d400/fb441e62df2d58994928907a91895ec62c2c42e6cd075c2700843b89.csv')
weather.Date = pd.to_datetime(weather.Date)
weather = weather.sort_values(by = ['Date','ID']).reset_index(drop = True)
weather.set_index(weather['ID'], inplace =True)
weather.groupby('ID', as_index = True, axis = 0)
no = weather.Date.nunique()
print(weather)
我想在一个特定的ID和元素上绘制一个数据值与日期的关系图
我试着重新键入一些数据来尝试和处理它,但是很难正确地完成这一切。你真的必须像特伦顿·麦金尼所说的那样提供你所有的数据
你可能会得到错误:
ValueError: 'ID' is both an index level and a column label, which is ambiguous.
我想解决这个问题的办法是在https://github.com/pandas-dev/pandas/issues/21080,但我不确定相关问题 更多 >
编程相关推荐