Skip to content
Zakir Syed edited this page Jan 30, 2019 · 10 revisions

Python-numpy-pandas How tos/ quick and dirty tricks

File IO

Create a folder in CWD(Current working directory)

my_dir = os.path.join(os.getcwd(), 'temp')
if not os.path.isdir(my_dir):
    os.makedirs(my_dir)

Get all files in a dir with a pattern in filename

my_files = glob.glob(my_dir+ '/' +"log_*.txt")

Clone this wiki locally