这一直有效,但没有。我当时在VSCode的jupyter笔记本上工作,想用一个groupby函数来计算一年中某一天的推文数量。
Tweet id float64 Tweet permalink object Tweet text object time datetime64[ns, UTC] impressions int64 engagements int64 engagement rate float64 retweets int64 replies int64 likes int64 user profile clicks int64 url clicks int64 hashtag clicks int64 detail expands int64 permalink clicks int64 app opens int64 app installs int64 follows int64 email tweet int64 dial phone int64 media views int64 media engagements int64 promoted impressions object promoted engagements object promoted engagement rate object promoted retweets object promoted replies object promoted likes object promoted user profile clicks object promoted url clicks object promoted hashtag clicks object promoted detail expands object promoted permalink clicks object promoted app opens object promoted app installs object promoted follows object promoted email tweet object promoted dial phone object promoted media views object promoted media engagements object day int64 dtype: object
我的问题是这样的:
df.groupby('day').count().plot()
它不会返回错误,但我得到了这个响应。为什么?
<AxesSubplot: xlabel='day'><Figure size 640x480 with 1 Axes>