Answers for "to_csv create folder"

0

to_csv create folder

import os

outname = 'name.csv'

outdir = './dir'
if not os.path.exists(outdir):
    os.mkdir(outdir)

fullname = os.path.join(outdir, outname)    

df.to_csv(fullname)
Posted by: Guest on June-26-2020

Python Answers by Framework

Browse Popular Code Answers by Language