Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

pandas date_range

index = pd.date_range(start='2020-8-15', end = '2021-8-11', freq='M')
print(index)

>>>DatetimeIndex(['2020-08-31', '2020-09-30', '2020-10-31', '2020-11-30',
                 '2020-12-31', '2021-01-31', '2021-02-28', '2021-03-31',
                 '2021-04-30', '2021-05-31', '2021-06-30', '2021-07-31'],
                 dtype='datetime64[ns]', freq='M')
Comment

pandas date range

import pandas as pd
date1 = '2011-05-03'
date2 = '2011-05-10'
mydates = pd.date_range(date1, date2).tolist()
Comment

www.pd.date_range

>>> pd.date_range(start='1/1/2018', periods=5, freq='3M')
DatetimeIndex(['2018-01-31', '2018-04-30', '2018-07-31', '2018-10-31',
               '2019-01-31'],
              dtype='datetime64[ns]', freq='3M')
Comment

www.pd.date_range

>>> pd.date_range(start='1/1/2018', periods=8)
DatetimeIndex(['2018-01-01', '2018-01-02', '2018-01-03', '2018-01-04',
               '2018-01-05', '2018-01-06', '2018-01-07', '2018-01-08'],
              dtype='datetime64[ns]', freq='D')
Comment

www.pd.date_range

>>> pd.date_range(start='1/1/2018', end='1/08/2018')
DatetimeIndex(['2018-01-01', '2018-01-02', '2018-01-03', '2018-01-04',
               '2018-01-05', '2018-01-06', '2018-01-07', '2018-01-08'],
              dtype='datetime64[ns]', freq='D')
Comment

PREVIOUS NEXT
Code Example
Python :: how to perform group by with django orm 
Python :: import file in another path python 
Python :: create sqlite table in python 
Python :: literal_eval in python 
Python :: primes python 
Python :: for i in array in range python 
Python :: Default stride value in keras 
Python :: global array python 
Python :: how to create a User and User profile in django rest framework 
Python :: boto 3 list EMR 
Python :: NumPy flipud Example 
Python :: how to for loop in python stackoverflow 
Python :: default python packages 
Python :: pandas filter rows by column value regex 
Python :: assignment operators in python 
Python :: python function create null matrix 
Python :: how to get all values from class in python 
Python :: convert series to dataframe pandas 
Python :: deleting key from dictionary 
Python :: pandas sub dataframe 
Python :: what does the combinations itertools in python do 
Python :: python print bytes 
Python :: python poetry 
Python :: list peek python 
Python :: removing stop words from the text 
Python :: loading bar 
Python :: full_like numpy 
Python :: show percentage in seaborn countplot site:stackoverflow.com 
Python :: python alphanum 
Python :: lambda functions python 
ADD CONTENT
Topic
Content
Source link
Name
3+9 =