xxxxxxxxxx
# 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)
xxxxxxxxxx
df.ix[row_no, col_no]
# or
df.iloc[row_no, col_no]
# Access cell with address (first row, first column) of dataframe
df.ix[0,0]
df.iloc[0, 0]
xxxxxxxxxx
import pandas as pd
data = ["thing"]
df = pd.DataFrame(data)
print(df.values)
print(df.values[0])
print(df.values[0][0]) #Get first element each time you want to remove the "[]" from a SINGLE value
>>>[['thing']]
>>>['thing']
>>>'thing'