August 2021
Beginner to intermediate
112 pages
1h 29m
English
| Puzzle 20 | It’s a Date! |
| | import pandas as pd |
| | |
| | start = pd.Timestamp.fromtimestamp(0).strftime('%Y-%m-%d') |
| | times = pd.date_range(start=start, freq='M', periods=2) |
| | print(times) |
Guess the Output | |
|---|---|
|
|
Try to guess what the output is before moving to the next page. |
This code will print:
| | DatetimeIndex(['1970-01-31', '1970-02-28'], dtype='datetime64[ns]', freq='M') |
There are two things that are puzzling here:
Read now
Unlock full access