I have many csv files in one a folder - "C:DataInput_Files"
I would like to load only few csv files whose name starts with "chunk".
The naming of csv files are chunk1, chunk2,chunk3,------,chunk150. While loading I want to append all of them into a single file (don't want to read all the files and then append).
Once the loading is done into python as single data frame, I would like to delete those csv files (chunk1,chunk2,--,chunk150) in my input folder "C:DataInput_Files"
I am using the below syntax. But is reading all csv files.
path = r'C:DataInput_Files'
all_files = glob.glob(path + "/*.csv")
frame = pd.DataFrame()
list_ = []
for file_ in allFiles:
df = pd.read_csv(file_,index_col=None, header=0)
list_.append(df)
frame = pd.concat(list_)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…