I have a huge dataset and I am trying to read it line by line. For now, I am reading the dataset using pandas:
df = pd.read_csv(\"mydata.csv\", sep =\',\', n
You are using nrows = 1
, wich means "Number of rows of file to read. Useful for reading pieces of large files"
So you are telling it to read only the first row and stop.
You should just remove the argument to read all the csv file into a DataFrame and then go line by line.
See the documentation for more details on usage : https://pandas.pydata.org/pandas-docs/stable/generated/pandas.read_csv.html