LoslegenKostenlos loslegen

Plot data from a DataFrame

pandas DataFrames are one of the most frequently used data structures in Python. They consist of clearly organized and labeled data, which make it easy to start exploring your data quickly. One of the best ways to explore a DataFrame is by employing the power of matplotlib. In this exercise, you'll perform a visualize exploration of bicycle crossings over the Freemont Bridge in Seattle held in the freemont_df DataFrame.

Remember that matplotlib was designed with MATLAB users in mind.

Diese Übung ist Teil des Kurses

Python for MATLAB Users

Kurs anzeigen

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# Create a bar plot of mean daily trips
plt.____(freemont_df.columns, 
         ____.mean(), 
         xerr=freemont_df.sem(), 
         capsize=3)

# Add an x-label and plot title
plt.xlabel('Average Trips')
plt.title('Average trips per day')

# Remember to show the plot
plt.show()
Code bearbeiten und ausführen