Saturday, February 7, 2026
HomeLanguagesPython | Pandas dataframe.get_value()

Python | Pandas dataframe.get_value()

Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas dataframe.get_value() function is used to quickly retrieve the single value in the data frame at the passed column and index. The input to the function is the row label and the column label.

Syntax: 

DataFrame.get_value(index, col, takeable=False) 

Parameters: 

  • index : row label 
  • col : column label 
  • takeable : interpret the index/col as indexers, default False 

Returns : value : scalar value

For link to CSV file Used in Code, click here 

Example #1: Use get_value() function to find the value of salary in the 10th row 

Python3




# importing pandas as pd
import pandas as pd
 
# Creating the dataframe
df = pd.read_csv("nba.csv")
 
# Print the dataframe
df


 

Python3




# applying get_value() function
df._get_value(10, 'Salary')


Output:

   

Example #2: Use get_value() function and pass the column index value rather than name. Note : We can also use integer indexer value of columns by setting the takeable parameter=True. 

Python3




# importing pandas as pd
import pandas as pd
 
# Creating the dataframe
df = pd.read_csv("nba.csv")
 
# column index value of "Name" column is 0
# We have set takeable = True
# to interpret the index / col as indexer
df.get_value(4, 0, takeable = True)


Output:

 

RELATED ARTICLES

1 COMMENT

Most Popular

Dominic
32491 POSTS0 COMMENTS
Milvus
126 POSTS0 COMMENTS
Nango Kala
6863 POSTS0 COMMENTS
Nicole Veronica
11987 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12076 POSTS0 COMMENTS
Shaida Kate Naidoo
6996 POSTS0 COMMENTS
Ted Musemwa
7238 POSTS0 COMMENTS
Thapelo Manthata
6947 POSTS0 COMMENTS
Umr Jansen
6933 POSTS0 COMMENTS