清洗数据
import os import shutil ''' num=0 for fi in os.listdir('./train_A/'): shutil.copy('./train_A/'+fi,'./all/'+str(num)+'_'+fi) shutil.copy('./train_B/'+'1'+fi[1:],'./all/'+str(num)+'_'+'1'+fi[1:]) num=num+1 ''' ''' num=0 for fi in os.listdir('./qq/'): num=fi.split('_')[0] name = fi[len(num)+1:] os.rename('./qq/'+fi,'./qq/'+name) ''' for fi in os.listdir('./qq/'): os.remove('./train_A/'+fi)