Jul-29-2020, 10:34 AM
I have the answer, but I don't understand it:
Line 12, in contrast, uses two brackets to look up (I think) rows in a dataframe for whom the combined_pts column value is greater than 70.
Thanks!
I just learned .columns is a component of DataFrames. I can print(super_bowl.combined_pts) to get a 2-column list of row # and combined points.
This helps me understand line 6.
Why does Line 12 require the double brackets, though?
from matplotlib import pyplot as plt %matplotlib inline #Jupiter notebook plt.style.use('seaborn') # Plot a histogram of combined points plt.hist(super_bowls.combined_pts) plt.xlabel('Combined Points') plt.ylabel('Number of Super Bowls') plt.show() # Display the highest- and lowest-scoring Super Bowls display(super_bowls[super_bowls['combined_pts'] > 70])Please compare lines 6 and 12. Why does the syntax for plot.hist include a dot between the name of dataframe (super_bowls) and column in that df (combined_pts)?
Line 12, in contrast, uses two brackets to look up (I think) rows in a dataframe for whom the combined_pts column value is greater than 70.
Thanks!
I just learned .columns is a component of DataFrames. I can print(super_bowl.combined_pts) to get a 2-column list of row # and combined points.
This helps me understand line 6.
Why does Line 12 require the double brackets, though?