Answers for "pandas get values by column name"

2

pandas df by row index

indices = [133, 22, 19, 203, 14, 1]
df_by_indices = df.iloc[indices, :]
Posted by: Guest on October-22-2020
0

pandas dataframe get values of a column by name

In [4]: ages = titanic["Age"]

In [5]: ages.head()
Out[5]: 
0    22.0
1    38.0
2    26.0
3    35.0
4    35.0
Name: Age, dtype: float64
Posted by: Guest on September-22-2021

Code answers related to "pandas get values by column name"

Python Answers by Framework

Browse Popular Code Answers by Language