Write a NumPy program to display all the dates for the month of March, 2017.
import numpy as np print("March, 2017") print(np.arange('2017-03', '2017-04', dtype='datetime64[D]'))
Sample Output:
March, 2017 ['2017-03-01' '2017-03-02' '2017-03-03' '2017-03-04' '2017-03-05' '2017-03-06' '2017-03-07' '2017-03-08' '2017-03-09' '2017-03-10' '2017-03-11' '2017-03-12' '2017-03-13' '2017-03-14' '2017-03-15' '2017-03-16' '2017-03-17' '2017-03-18' '2017-03-19' '2017-03-20' '2017-03-21' '2017-03-22' '2017-03-23' '2017-03-24' '2017-03-25' '2017-03-26' '2017-03-27' '2017-03-28' '2017-03-29' '2017-03-30' '2017-03-31']
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer