Write a NumPy program to get the dates of yesterday, today and tomorrow.
import numpy as np yesterday = np.datetime64('today', 'D') - np.timedelta64(1, 'D') print("Yestraday: ",yesterday) today = np.datetime64('today', 'D') print("Today: ",today) tomorrow = np.datetime64('today', 'D') + np.timedelta64(1, 'D') print("Tomorrow: ",tomorrow)
Sample Output:
Yestraday: 2017-03-24 Today: 2017-03-25 Tomorrow: 2017-03-26
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