numpy-100 icon indicating copy to clipboard operation
numpy-100 copied to clipboard

Alternative solution for Q33

Open AliMahdavirad0 opened this issue 1 year ago • 1 comments

Hello,

As an alternative answer to Q33:

yesterday = np.datetime64('today') - 1
today     = np.datetime64('today')
tomorrow  = np.datetime64('today') + 1
print(yesterday, today, tomorrow)

AliMahdavirad0 avatar Sep 12 '24 16:09 AliMahdavirad0

Thanks. You're right but your solution hides the usage of timedelta64 that also offer the possibilityto subract hours, week or month (for example).

rougier avatar Oct 21 '24 13:10 rougier