Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. series = read_csv('shampoo-sales.csv', header=0, index_col=0, squeeze=True).
  2.  
  3. series.index = pd.to_datetime(series.index).
  4.  
  5. Out of bounds nanosecond timestamp: 1-01-01 00:00:00
  6.  
  7. In[20]:
  8. series.index = pd.to_datetime(series.index, format='%d-%m')
  9. series.index
  10.  
  11. Out[20]:
  12. DatetimeIndex(['1900-01-01', '1900-02-01', '1900-03-01', '1900-04-01',
  13. '1900-05-01', '1900-06-01', '1900-07-01', '1900-08-01',
  14. '1900-09-01', '1900-10-01', '1900-11-01', '1900-12-01',
  15. '1900-01-02', '1900-02-02', '1900-03-02', '1900-04-02',
  16. '1900-05-02', '1900-06-02', '1900-07-02', '1900-08-02',
  17. '1900-09-02', '1900-10-02', '1900-11-02', '1900-12-02',
  18. '1900-01-03', '1900-02-03', '1900-03-03', '1900-04-03',
  19. '1900-05-03', '1900-06-03', '1900-07-03', '1900-08-03',
  20. '1900-09-03', '1900-10-03', '1900-11-03', '1900-12-03'],
  21. dtype='datetime64[ns]', name='Month', freq=None)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement