Computer scienceData scienceInstrumentsPandasData analysis with pandas

Summarizing numeric columns

Rock or Mine?

Report a typo

For now, when you go to the IDE tab, you can solve this problem only via Pycharm. We are sorry for the inconvenience, we will fix this as soon as we can. If you prefer to solve the problem via a different IDE, open it manually and then copy the solution to the website.

You are working with a DataFrame, df_rock, that contains sonar signals from two object classes: rocks and mines. In the first five columns, you can see the wavelengths that the sonar received from different angles.

Load the given data as a DataFrame, then calculate the median of the null_deg column for rock "R" and for mine "M" objects separately. Below you can see the output sample. Remember to round your answer up to three decimal places.

Tip: Please, check the format of your answer, it must be "M = value R = value".

Sample Input 1:

,null_deg,sixty_deg,ninety_deg,straight_angle,twoforty_deg,labels
0,0.740204,0.981484,0.605161,0.67712,0.927914,M
1,0.788051,0.68378,0.504151,0.713523,0.690165,M
2,0.744574,0.668011,0.564707,0.804288,0.713663,R
3,0.560475,0.487072,0.103085,0.668011,0.805988,R

Sample Output 1:

M = 0.764 R = 0.653
Write code in your IDE to process the text file and display the results below
___

Create a free account to access the full topic