You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You'll notice in the summary above that there are a few columns which are are either entirely empty or only have a few values in them. Let's get rid of all of those with dropna.
1633
1621
1634
1622
The argument `axis=1` to `dropna` means "drop columns", not rows", and `how='any'` means "drop the column if any value is null".
@@ -1758,12 +1746,12 @@ Output:
1758
1746
</div>
1759
1747
</div>
1760
1748
1761
-
The Year/Month/Day/Time columns are redundant, though, and the Data Quality column doesn't look too useful. Let's get rid of those.
1749
+
The Year/Month/Day/Time columns are redundant, though. Let's get rid of those.
1762
1750
1763
1751
The `axis=1` argument means "Drop columns", like before. The default for operations like `dropna` and `drop` is always to operate on rows.
@@ -1857,7 +1845,7 @@ Awesome! We now only have the relevant columns, and it's much more manageable.
1857
1845
This one's just for fun -- we've already done this before, using groupby and aggregate! We will learn whether or not it gets colder at night. Well, obviously. But let's do it anyway.
Now we can get all the months at once. This will take a little while to run.
2051
2036
2052
2037
```python
2053
-
data_by_month = [download_weather_month(2012, i) for i inrange(1, 13)]
2038
+
data_by_month = [download_weather_month(2012, i) for i inrange(1, 12)]
2054
2039
```
2055
2040
2056
2041
Once we have this, it's easy to concatenate all the dataframes together into one big dataframe using [pd.concat](http://pandas.pydata.org/pandas-docs/version/0.20/generated/pandas.concat.html). And now we have the whole year's data!
0 commit comments