Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. cutMapping = {'Fair': 0 , 'Good': 1, 'Very Good': 2, 'Premium': 3, 'Ideal': 4}
  2. colorMapping = {'J': 0, 'I': 1, 'H': 2, 'G': 3, 'F': 4, 'E': 5, 'D': 6 }
  3. clarityMapping = {'I1': 0, 'SI2': 1, 'SI1': 2, 'VS2': 3, 'VS1': 4, 'VVS2': 5, 'VVS1': 6, 'IF' : 7}
  4.  
  5. data = data.replace({'cut': cutMapping})
  6. data = data.replace({'color': colorMapping})
  7. data = data.replace({'clarity': clarityMapping})
  8.  
  9. y = data.price.values
  10. X = data.drop('price', axis = 1)
  11. data.head()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement