Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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)
Source by pythonexamples.org #
 
PREVIOUS NEXT
Tagged: #index #pandas #dataframe #python
ADD COMMENT
Topic
Name
8+7 =