I am trying to read 5 columns from a 6 column csv data and use each row in a formula and itarete for all the rows.
import pandas as pd
df = pd.read_csv("/home/user/trial/blabla.csv", names=["name", "loc1", "loc2", "loc3", "loc4", "trial", "safe"])
a = something(b=df["trial"])
b1 = anotherhing(df["loc1"], df["loc2"], a)
b2 = anotherhing(df["loc3"], df["loc4"], a)
the file is csv file is something like this with hunderds of rows
john 12.1 22.3 33.5 88.2 0.2 1
jack 25.3 11.8 93.1 08.1 0.01 1
when I put values by hand it works all in well. However, when I put the df columns to do it for each row. It does not work. It reads all columns at once instead of 1 by 1.
What am I doing wrong here?