Question: Read the data in the text le aaa.txt into a pandas DataFrame and perform the following tasks. a) Based on the values from the file

Read the data in the text le aaa.txt into a pandas DataFrame and perform the following tasks.

a) Based on the values from the file aaa.txt, nd

the average density of each of the planet relative to that of the Earth and add the results as a column in your DataFrame. (15%)

b) Print out DataFrame sorted from the largest- to smallest diameter planet. (3%)

c) Make a list of planets that have masses greater than that of Earth, sorted from least to most massive planet. (3%)

d) list of all the planets that are more massive than the Earth but have a smaller gravitational force at their surface (4%)

e) Make bar plot of the planets relative densities you added in part a). On x axis, put Planet names; on y axis, put density values (10%)

aaa.txt is below

planet,distance,mass,gravity,diameter,year Mercury,0.39,0.055,0.38,0.38,0.24 Venus,0.72,0.82,0.91,0.95,0.62 Earth,1.00,1.00,1.00,1.00,1.00 Mars,1.52,0.11,0.38,0.53,1.88 Jupiter,5.20,318,2.36,11.2,11.9 Saturn,9.58,95,0.92,9.45,29 Uranus,19.2,15,0.89,4.01,84 Neptune,30.0,17,1.12,3.88,164 Pluto,39.5,0.0024,0.071,0.19,248

I'll give a thumbs up for correct solution. It will be great if you can add screenshot of the output. Thanks in advance

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!