我有一些跨越 10 年的日常价值观。日期、温度"1981-01-01",20.7"1981-01-02",17.9..."1990-12-31",13.0我正在将这些值从 csv 读取到这样的数据帧中df = pd.read_csv(r'.\data\daily-minimum-temperatures.csv')df['Date'] = pd.to_datetime(df['Date'])我想按年份对所有这些值进行分组以绘制 10 个折线图(每年一个)以便比较它们。我试着像这样使用石斑鱼grouper = df.groupby(['Date', pd.Grouper(key='Date', freq='Y')])我得到了长度为 10 的 grouper 对象 (DataFrameGroupBy)。我知道这个对象代表我在十年内分组的数据。但是当试图绘制这个对象时,我得到一个错误。grouper.plot()RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).我怎样才能做到这一点 ?
添加回答
举报
0/150
提交
取消