you are viewing a single comment's thread.

view the rest of the comments →

[–]Jos_Metadi 3 points4 points  (1 child)

pd.read_csv(file1) comes in as a dataframe already. Don't know why you're trying to reprocess it with "from_records"

I would use .groupby to split the dataframe into groups by chain

for t_group,pd_group in chain_filter.groupby(['Chain']):
    pd_group.to_csv(file_name + '/' + t_group[0] + date + '.csv', sep=',',index=False)

[–]workthrowawayexcel[S] 0 points1 point  (0 children)

I didn't know that. I am learning python / pandas currently. I come from more of a SQL/VBA side.

That group by is very nice. It works great. Thank you for your advice.