I'm trying to extract objects from a dataframe via the .iloc
function and convert those to int
to perform some operations on them. Specifically, I want to subtract two values V3 = V1 - V2
.
d = {'col1': [1, 2], 'col2': [3, 4]}
df = pd.DataFrame(data=d)
V1 = df.iloc[[0],[0]]
V2 = df.iloc[[1],[1]]
I've tried some solutions that convert the whole column but they don't seem to be working.