I tried to open all the files(csv) of a directory and append a column to new dataframe. But, os.listdir() doesn't show all files of the directory.. skipped few of them
import os
path1=r'D:\data files'
filenames=os.listdir(path1)
print(filenames)
You could try doing it with system commands
files = os.system("cd /data\ files && ls")
You might have to add in the path of the directory but this should to the trick. Hope this helps
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.