Guest User

Untitled

a guest
Dec 15th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. # Data Cleaning based on Data Analysis using Python & EDA
  2.  
  3. # Removing the wage outlier row based on EDA observation
  4. crimeData = crimeData[crimeData.county != 185] # very high wser & prob of conviction
  5. crimeData = crimeData[crimeData.county != 115] # prob of arrest > 1
  6.  
  7. # Removing rows with probability of arrest and conviction > 1
  8. crimeData = crimeData[crimeData['prbarr'] < 1]
  9. crimeData = crimeData[crimeData['prbconv'] < 1]
  10.  
  11. # The location cannot be both west and central together.
  12. crimeData = crimeData[crimeData['west']+crimeData['central'] <= 1]
  13.  
  14. # dropping the Year column as it doesn’t help in prediction
  15. crimeData = crimeData.drop('year', axis=1)
Add Comment
Please, Sign In to add comment