I am trying to extract a cell value from a dataframe, then why I always get a series instead of a value.
For example:
df_test=pd.DataFrame({'Well':['test1','test2','test3'],'Region':['east','west','east']})
df_test
Well Region
0 test1 east
1 test2 west
2 test3 eas
well="test2"
region_thiswell=df_test.loc[df_test['Well']==well,'Region']
region_thiswell
1 west
Name: Region, dtype: object
I am expecting variable of region_thiswell is equal to ‘west’ string only. Why I am getting a series?
Thanks
You need to sign in to view this answers