Datetime issue with matplotlib

前端 未结 5 1104
离开以前
离开以前 2021-01-18 02:09

I\'m pulling my hair to display a series with matplotlib.

I\'m working with python 2.7. I have a pandas Dataframe with dates. I converted dates to datetime and I\'m

5条回答
  •  醉梦人生
    2021-01-18 02:47

    There are missing values between the datetimes.

    idx = pd.date_range(pd.to_datetime(first_month).item(), pd.to_datetime(last_month).item(), freq='MS')
    
    data = data.reindex(idx)
    

提交回复
热议问题