Select Pandas DataFrame Rows, Difference between .iloc and .loc
0. How to select a row of a DataFrame? 1. Select using .iloc[] There is a DataFrame of 4 animals as above. Below is the codes for the DataFrame. import pandas as pd dict_zoo = {'Name' : ['Panda', 'Rabbit', 'Lion', 'Duck'], 'Food' : ['Carrot', 'Bamboo', 'Meat', 'Fish'], 'Age' : [5, 2, 7, 3], 'Species' : ['Mammals', 'Mammals', 'Mammals', 'Birds']} df_zoo = pd.DataFrame(dict_zoo) Each row is equiva..
카테고리 없음
2022. 11. 11. 00:48