Looking at the farmers market data
Loaded is a new dataset, markets
. Each row of this DataFrame belongs to an individual farmers market in the continental United States with various information about the market contained in the columns. In this exercise, explore the columns of the data to get familiar with them for future analysis and plotting.
As a first step, print out the first three lines of markets
to get an idea of what type of data the columns encode. Then look at the summary descriptions of all of the columns. Since there are so many columns in the DataFrame, you'll want to turn the results 'sideways' by transposing the output to avoid cutting off rows.
Diese Übung ist Teil des Kurses
Improving Your Data Visualizations in Python
Anleitung zur Übung
- Print the first three rows of the data and transpose by chaining the
.transpose()
method to the DataFrame. - Print the basic description of every column along with its median (which is already specified for you with the
percentiles
argument) and again chain the.transpose()
method.
Interaktive Übung
Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.
# Print first three rows of data and transpose
first_rows = markets.____(____).____()
print(first_rows)
# Get descriptions of every column
col_descriptions = markets.____(____ = '____',
percentiles = [0.5]).____()
print(col_descriptions)