accessing index of dataframe python
# For accessing dataframe index:
df.index
# For retrieving dataframe index as list:
df.index.tolist()
# for accessing value for an index:
df.at[index_value, column_value]
accessing index of dataframe python
# For accessing dataframe index:
df.index
# For retrieving dataframe index as list:
df.index.tolist()
# for accessing value for an index:
df.at[index_value, column_value]
retrieve row by index pandas
rowData = dfObj.loc[ 'b' , : ]
how to get index of pandas dataframe python
import pandas as pd
df = pd.DataFrame(
[[88, 72, 67],
[23, 78, 62],
[55, 54, 76]],
index=[2, 4, 9],
columns=['a', 'b', 'c'])
index = df.index
print(index)
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us