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

HTML/CSS - Automatically set height width from background image? -

php - Mysql Show Process - Sleep Commands and what to do -

c - What is the address of buf (the local variable in the main function)? -