import sys
import csv
import numpy
import pandas
import shutil
import os
if __name__ == '__main__':
f1 = pandas.read_csv('trainLabels.csv')
print f1
record_num = int (f1.describe().ix[0,0])
print record_num
for i in range(record_num):
record = f1.ix[i,:]
pic_name = record['image'] + '.png'
print record['level']
print os.path.join('/home/zyj/unifiedData/train', pic_name)
print os.path.join('/home/zyj/unifiedData/', str(record['level']),pic_name)
shutil.copy(os.path.join('/home/zyj/unifiedData/train', pic_name), \
os.path.join('/home/zyj/unifiedData', record['level'].astype(str),pic_name))