I have below python function to export data frame to csv file. I call it using below script
finalExport(dataAllR, sourcePath, header, started)
dataAllR: Name of dataframesourcePath: Pathheader: List of columnsstarted: time
def finalExport(data, exportPath, header, te):
print('# USDF: "finalExport" :-')
exportPath = exportPath + '\\final_py_upload' + data + '.csv'
data.to_csv(exportPath, columns = header, sep = ',', index = False)
print('Process done, result file stored in: ', exportPath)
if te != '': tpe(te)
return
I want to use name of dataframe i.e dataAllR that I passed while calling function in script:
exportPath = exportPath + '\\final_py_upload' + data + '.csv'
# ^
I want to generate file name as per data frame name.
Please help on this.