df = pd.read_csv(input_file, float_precision='round-trip') groups = df.groupby(df['origin_file_name']) for group in groups: group[1].drop('origin_file_name', axis=1, inplace=True) group[1].to_csv(os.path.join(output_folder, '{}.csv'.format(str(group[0]))), index=False, encoding='utf-8-sig')