![]() ![]() Let's create a simple data frame: > import pandas as pd > import numpy as np > data = np.arange(1,13) > data = data.reshape(3,4) > data array(,, ]) > columns = > index = > df = pd.DataFrame(data=data,index=index,columns=columns) > df Home Car Sport Food Alice 1 2 3 4 Bob 5 6 7 8 Emma 9 10 11 12 to get the row names a solution is to do: > df.index Get the row names of a pandas data frame (Exemple 1) Get the row names of a pandas data frame (Exemple 2). ![]() Get the row names of a pandas data frame (Exemple 1).Get the row names of a pandas data frame.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |