1# how to select a single cell in a pandas dataframe
2
3import pandas as pd
4
5old = pd.DataFrame({'A' : [4,5], 'B' : [10,20], 'C' : ['cell wanted',50], 'D' : [-30,-50]})
6var = old['C'].values[0]
7
8print(var)
1import pandas as pd
2
3data = ["thing"]
4df = pd.DataFrame(data)
5
6print(df.values)
7print(df.values[0])
8print(df.values[0][0]) #Get first element each time you want to remove the "[]" from a SINGLE value
9
10>>>[['thing']]
11>>>['thing']
12>>>'thing'