March 2020
Beginner to intermediate
352 pages
8h 40m
English
During EDA, we often need to rearrange data in a dataframe in some consistent manner. This can be done with hierarchical indexing using two actions:
We will look at the following example:
data = np.arange(15).reshape((3,5))indexers = ['Rainfall', 'Humidity', 'Wind']dframe1 = pd.DataFrame(data, index=indexers, columns=['Bergen', 'Oslo', 'Trondheim', 'Stavanger', 'Kristiansand'])dframe1
The output of the preceding snippet is as follows:
Read now
Unlock full access