7. Read files (2%)
List files in a directory
from os import listdir
from os.path import isfile, join
onlyfiles = [f for f in listdir(mypath) if isfile(join(mypath, f))]from os import walk
f = []
for (dirpath, dirnames, filenames) in walk(mypath):
f.extend(filenames)
breakRead CSV
Methods to read CSV
by hand
by csv_reader
In Pandas way
JSON
Typical json
Read XLS
Last updated