Answers for "pandas df get values of specific cell where row value equals"

2

how to select a single cell in a pandas dataframe

# how to select a single cell in a pandas dataframe

import pandas as pd

old = pd.DataFrame({'A' : [4,5], 'B' : [10,20], 'C' : ['cell wanted',50], 'D' : [-30,-50]})
var = old['C'].values[0]

print(var)
Posted by: Guest on September-27-2021
0

get value of a pd for specific values in column

df.loc[df['column_name'].isin(some_values)]
Posted by: Guest on April-23-2020

Code answers related to "pandas df get values of specific cell where row value equals"

Python Answers by Framework

Browse Popular Code Answers by Language