Pandas: Return Hour from Datetime Column Directly

The Solution to Pandas: Return Hour from Datetime Column Directly is


For posterity: as of 0.15.0, there is a handy .dt accessor you can use to pull such values from a datetime/period series (in the above case, just sales.timestamp.dt.hour!

~ Answered on 2015-06-08 19:20:23


Most Viewed Questions: