Heavy task

Report a typo

Here you have a part of the Penguins dataset:

+----+-----------+---------------+--------+
|    | species   |   body_mass_g | sex    |
|----+-----------+---------------+--------|
|  0 | Gentoo    |          5550 | MALE   |
|  1 | Gentoo    |          5850 | MALE   |
|  2 | Adelie    |          3975 | MALE   |
|  3 | Chinstrap |          4050 | MALE   |
|  4 | Adelie    |          3200 | FEMALE |
|  5 | Adelie    |          4700 | MALE   |
+----+-----------+---------------+--------+

The body_mass_g column has the float data type. Select the rows with penguins heavier than 4.5 kilograms, take only the body_mass_g column, and print the result.

This is what you should get at the end:

+----+---------------+
|    |   body_mass_g |
|----+---------------|
|  0 |          5550 |
|  1 |          5850 |
|  5 |          4700 |
+----+---------------+

Note that the body_mass_g column should be returned as a DataFrame.

Write a program in Python 3
import pandas as pd

penguins_dict = {'species': {0: 'Gentoo', 1: 'Gentoo', 2: 'Adelie', 3: 'Chinstrap', 4: 'Adelie', 5: 'Adelie'}, 'body_mass_g': {0: 5550.0, 1: 5850.0, 2: 3975.0, 3: 4050.0, 4: 3200.0, 5: 4700.0}, 'sex': {0: 'MALE', 1: 'MALE', 2: 'MALE', 3: 'MALE', 4: 'FEMALE', 5: 'MALE'}}

penguins_df = pd.DataFrame(penguins_dict)

# your code here
print(...)
___

Create a free account to access the full topic