August 2021
Beginner to intermediate
112 pages
1h 29m
English
| Puzzle 3 | Month by Month |
| | from io import StringIO |
| | import pandas as pd |
| | |
| | csv_data = '''\ |
| | day,hits |
| | 2020-01-01,400 |
| | 2020-02-02,800 |
| | 2020-02-03,600 |
| | ''' |
| | |
| | df = pd.read_csv(StringIO(csv_data)) |
| | print(df['day'].dt.month.unique()) |
Guess the Output | |
|---|---|
|
|
Try to guess what the output is before moving to the next page. |
This code will raise an AttributeError.
The comma-separated values (CSV) format does not have a ...
Read now
Unlock full access