I have a .csv file that contains four columns and about 700000 rows. My problem is I can't access a specific cell, but only the whole row. My code:
import pandas as pd
data = pd.read_csv("example.csv")
entries = data["entry"].astype(str)
payments = data["payment_type"].astype(str)
origins = data["origin"].astype(str)
for row in entries:
if row[26] == "Y":
data["payment_type"] = "sample"
if row[27] == "Y":
data["payment_type"] = "Check Card"
...
E.g. In the first row of the .csv file, I want to format the cell in the "origin" column, according to the "entry" column of the same row. The script does this, but as written now, it formats the whole column according to what the value of the last entry is. I think my problem is in the "for" loop, on how to access the specific row of a column.
Any help would be appreciated.
Thank you in advance.