Meteorite_Landings.csv
file, update the year
column to only contain the year, convert it to a numeric data type, and create a new column indicating whether the meteorite was observed falling before 1970. Set the index to the id
column and extract all the rows with IDs between 10,036 and 10,040 (inclusive) with loc[]
.¶year.str.slice()
to grab a substring.¶loc[]
to select the range.¶year
column. Can you find it? (Don't spend too much time on this.)¶
Meteorite_Landings.csv
file, create a pivot table that shows both the number of meteorites and the 95th percentile of meteorite mass for those that were found versus observed falling per year from 2005 through 2009 (inclusive). Hint: Be sure to convert the year
column to a number as we did in the previous exercise.¶
x
coordinates will be 1, 2, and 3 for 2019, 2020, and 2021, respectively. Alternatively, to avoid hardcoding values, you can use the Axes.get_xticklabels()
method, in which case you should look at the documentation for the Text
class.¶