Import csv (beginner's question)

import csv
import numpy as np
# import nyc_taxi.csv as a list of lists
f = open("nyc_taxis.csv", "r")
taxi_list = list(csv.reader(f))

my question is what is “f” here? is it just a variable where we could use any other alphabets instead of “f”, or is it standard?

You are correct, f is just a variable. So you could replace it with whatever you wanted (as long as it doesn’t break any variable naming rules).

2 Likes