how to read numbers in csv files python 1

how to read numbers in csv files python

with open('tab.csv', newline='') as file:
    reader = csv.reader(file, quoting=csv.QUOTE_NONNUMERIC)

Here is what the above code is Doing:
1. We open the file with the open() function.
2. We pass the file object to the csv.reader() function.
3. We pass the reader object to the list() function.
4. We assign the resulting list to the variable data.

Similar Posts