text_plain_output_1.png
from shutil import copyfile

import os

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

import os
df = pd.read_csv('/kaggle/input/cassava-leaf-disease-classification/train.csv')
[os.mkdir(os.path.join('/kaggle/working', 'label_' + str(x))) for x in df.label.unique()]

df = pd.read_csv('/kaggle/input/cassava-leaf-disease-classification/train.csv')
from shutil import copyfile
for a, b in df.iterrows():
    src = os.path.join('/kaggle/input/cassava-leaf-disease-classification/train_images', b.image_id)
    dst = os.path.join('/kaggle/working', 'label_' + str(b.label), b.image_id)
    print(src)
    print(dst)
    copyfile(src, dst)