Question: Understand lesson 1 . py completely. Modify the lecture code as follows. Plot the largest snowfall by year. Make Bridger Bowl the title of the
Understand lessonpy completely.
Modify the lecture code as follows.
Plot the largest snowfall by year.
Make Bridger Bowl the title of the chart.
The lecture code draws a bar chart. Draw at least two other types of graphs with the data.
import pandas as pd
import matplotlib.pyplot as plt
import sys # to determine Python version number
import matplotlib # to determine Matplotlib version number
printPython version sysversion
printPandas version pdversion
printMatplotlib version matplotlib.version
print
# Create Data
#
years
# bridger bowl season
totalsnowfall # inches
largestsnowfall # inches
BridgerDataSet listzipyears totalsnowfall, largestsnowfall
printBridgerDataSet: BridgerDataSet,
data pdDataFramedata BridgerDataSet, columnsSeason "Total", "Largest"
printBridger DataFrame"
print
printdata
data.tocsvbridgercsvindexFalse,headerFalse
# Get Data
bridger pdreadcsvbridgercsv namesSeason 'Total', 'Largest'
print
Bridger DataFrame after reading csv file"
print
printbridger
# Prepare Data
if bridgerTotal.dtype 'int:
print
Total snowfall is of type int
else:
print
Total Snowfall is of type", bridger.Total.dtype
# Analyze Data
sorteddata bridger.sortvaluesTotal ascendingFalse
print
Sorted Bridger Data Set"
print
printsorteddata
print
The least total snowfall was", bridgerTotalmin
# Display Data
bridger.plotx"Season", y"Total", kind"bar", color"yellow",
xlabel"Season", ylabel"Total Snowfall"
pltshow
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
