From d64ce54576e38238ffb933d859c7c58d1ab35eab Mon Sep 17 00:00:00 2001 From: Joseph Finlayson Date: Sun, 28 Feb 2021 18:34:55 +0100 Subject: [PATCH] using `get_level_values`is way more readable --- modern_3_indexes.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modern_3_indexes.ipynb b/modern_3_indexes.ipynb index ad33cbd..4e0cb34 100644 --- a/modern_3_indexes.ipynb +++ b/modern_3_indexes.ipynb @@ -756,7 +756,7 @@ "\n", "flights = pd.read_hdf('data/flights.h5', 'flights')\n", "\n", - "weather_locs = weather.index.levels[0]\n", + "weather_locs = weather.index.get_level_values('station')\n", "# The `categories` attribute of a Categorical is an Index\n", "origin_locs = flights.origin.cat.categories\n", "dest_locs = flights.dest.cat.categories\n",