Dec-05-2019, 11:25 PM
You can use
pandas.read_csv
to load csv into Python memory as Pandas.DataFrame instance. Further, you can use DataFrame's groupby method. To use it you will need to specify desired grouping variables (e.g. 'dx_type' in your case). Finally, you can iterate over all groups, find which files belong to each group (from image_id
column) and copy these files to specific directories.