我不知道如何解决此错误? 有人可以帮我吗?
我首先将某些属性的日期时间分开,这样我就可以 一些不同的图。
uber2015 ['Pickup_date'] = pd.to_datetime(uber2015['Pickup_date'], format = '%Y-%m-%d %H:%M:%S')
uber2015 ['DayofWeekNum'] = uber2015['Pickup_date'].dt.dayofweek
uber2015['Month'] = uber2015['Pickup_date'].dt.month
uber2015['Hour'] = uber2015['Pickup_date'].dt.hour
uber2015['Day'] = uber2015 ['Pickup_date'].dt.day
print(uber2015.head(5))
# Uber pickups by Hour in NYC
sns.set_style('whitegrid')
ax = uber2015 = sns.countplot(x= "Hour", data=uber2015, color="lightsteelblue")
ax.set_xlabel('Hour of the Day', fontsize = 12)
ax.set_ylabel('Count of Uber Pickups', fontsize = 12)
ax.set_title('Uber Pickups by HOur in NYC (Jan-Jun 2015)', fontsize = 16)
ax.tick_params(labelsize = 8)
plt.show()