Skip to content

Commit 3dca0d1

Browse files
committed
cleanned data file
1 parent 8834115 commit 3dca0d1

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

task1.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,5 +75,16 @@
7575
tranDf['PACK_SIZE']=tranDf['PROD_NAME'].str.extract(r'(\d{1,3})')
7676
tranDf['PACK_SIZE']=tranDf['PACK_SIZE'].astype(str).astype(int)
7777

78+
#BRAND NAME
79+
tranDf['BRAND_NAME']=tranDf['PROD_NAME'].apply(lambda x: x.split(" ")[0])
80+
81+
tranDf['BRAND_NAME']=tranDf['BRAND_NAME'].apply(lambda x: x if 'red' not in x.lower() else 'RRD')
82+
83+
###customer dataset
84+
85+
#cleaned dataset
86+
87+
data.to_csv("QVI_data.csv",index=False)
88+
7889

7990

0 commit comments

Comments
 (0)