Computer scienceData scienceInstrumentsPandasStoring data with pandas

Accessing data in a DataFrame

Back to normal

Report a typo

You have a part of the Penguins dataset penguins_example. Replace this funky index with a regular integer range (starting from 0) and print the resulting DataFrame. The index should be destroyed.

Note that you don't need to import pandas. The dataset is already loaded, and the variable that contains the dataset is called penguins_example.

Sample Input 1:

                    species	   bill_length_mm	bill_depth_mm
first	            Adelie	    41.1	        18.2
peng #2	            Adelie	    39.6	        17.7
third	            Chinstrap	    50.0                19.5
4	            Chinstrap	    54.2	        20.8
another one	    Gentoo	    41.7	        14.7
5	            Gentoo	    45.5	        13.9

Sample Output 1:

     species  bill_length_mm  bill_depth_mm
0     Adelie            41.1           18.2
1     Adelie            39.6           17.7
2  Chinstrap            50.0           19.5
3  Chinstrap            54.2           20.8
4     Gentoo            41.7           14.7
5     Gentoo            45.5           13.9
Write a program in Python 3
# your code here, the dataset is already loaded. The variable name is penguins_example.

...

print(penguins_example)
___

Create a free account to access the full topic