Answered step by step
Verified Expert Solution
Question
1 Approved Answer
need help with this one please. python, jupyter, numpy HW3-2: Age of Presidents You can access the Presidential age-related data via (https://raw.githubusercontent.com/tisage/ClSC540/main/data/Lab 3/president timelines.csv). Use
need help with this one please. python, jupyter, numpy
HW3-2: Age of Presidents You can access the Presidential age-related data via (https://raw.githubusercontent.com/tisage/ClSC540/main/data/Lab 3/president timelines.csv). Use pandas library to read your data. (Hint: you might need to pass an argument parse_dates = [' Birth' , 'TermBegin'] in your pd.read_csv() statements) Then, write a piece of code using numpy to analyze: - The Average (mean \& median) Age for all presidents - The Top 5 Youngest US Presidents - The Top 5 Oldest US Presidents - Use matplotlib to show the histogram of ages' distribution Hints: - You might need to take care of datetime , - Also, should pay attention on the shape of array. Use .reshape() if necessary - To find top N, many different approaches, such as argpartition(), or sort first and then index slicing, etc. If = pd.read_csv('https://raw.githubusercontent.com/tisage/cisc540/main/data/Lab_3/president_timelines.csv', header =0, parse_dates =[ 'Birth', 'TermBegin' ]).valuesStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started