Advertisement
cd62131

interpret csv, move files

Nov 2nd, 2018
666
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.20 KB | None | 0 0
  1. import pandas as pd
  2. import os
  3. import shutil
  4. df = pd.read_csv('your.csv')
  5. for i, row in df.iterrows():
  6.     os.makedirs(f"{row['label']}", exist_ok=True)
  7.     shutil.move(row['filename'], f"{row['label']}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement