Pandas series of datetimes in python -


I have a series that is purely datetimes. Call it at chain 1 .

How can I remove the series from the series in the most effective way to create a new series of months only?

For example.

  series1.month  

does not work. But for every line, it will work

In panda version 0.14 and older, you apply Can date to date value:

  chain 1 .apply (Lambda x: x.month)   to remove  In 

0.15, a new datetime series accessor simplifies the operation (thanks @ crisb):

  series1.dt.month  

here is one.


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -