我有以下 Dataframe :
Customer Complaint \
date_index
2015-04-22 15:53:50 Comcast Cable Internet Speeds
2015-08-04 10:22:56 Payment disappear - service got disconnected
2015-04-18 09:55:47 Speed and Service
2015-07-05 11:59:35 Comcast Imposed a New Usage Cap of 300GB that ...
2015-05-26 13:25:26 Comcast not working and no service to boot
Date Date_month_year Time \
date_index
2015-04-22 15:53:50 22-04-15 2015-04-22 3:53:50 PM
2015-08-04 10:22:56 04-08-15 2015-08-04 10:22:56 AM
2015-04-18 09:55:47 18-04-15 2015-04-18 9:55:47 AM
2015-07-05 11:59:35 05-07-15 2015-07-05 11:59:35 AM
2015-05-26 13:25:26 26-05-15 2015-05-26 1:25:26 PM
我想将每个日期的投诉数量分组(类似于 df['Date_month_year'].value_counts()
)并绘制一个时间序列图。如果我和你一起去 df['Date_month_year'].value_counts().plot(title='Complaints by Date', xlabel='Date', ylabel='Complaints')
或 df.groupby(pd.Grouper(freq='D')).size().plot(title='Complaints by date', xlabel='Month',ylabel='Complaints')
我得到以下输出,其中在x轴上跳过特定日期,只显示月份。如何解决这个问题?非常感谢。
暂无答案!
目前还没有任何答案,快来回答吧!