Skip to content

Instantly share code, notes, and snippets.

@BinarySpoon
Created September 29, 2020 10:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BinarySpoon/d23c5d42fe5c7331a313a0fe35bc2f2b to your computer and use it in GitHub Desktop.
Save BinarySpoon/d23c5d42fe5c7331a313a0fe35bc2f2b to your computer and use it in GitHub Desktop.
# Remove Non Existing Features In Test Data
feature_remove_list = [
'balance_due',
'collection_status',
'compliance_detail',
'payment_amount',
'payment_date',
'payment_status'
]
train_data.drop(feature_remove_list, axis=1, inplace=True)
# Remove String Data
string_remove_list = ['violator_name', 'zip_code', 'country', 'city',
'inspector_name', 'violation_street_number', 'violation_street_name',
'violation_zip_code', 'violation_description',
'mailing_address_str_number', 'mailing_address_str_name',
'non_us_str_code', 'agency_name', 'state', 'disposition',
'ticket_issued_date', 'hearing_date', 'grafitti_status', 'violation_code'
]
train_data.drop(string_remove_list, axis=1, inplace=True)
test_data.drop(string_remove_list, axis=1, inplace=True)
# Fill NaN Lat Lon Values
train_data.lat.fillna(method='pad',inplace=True)
train_data.lon.fillna(method='pad',inplace=True)
test_data.lat.fillna(method='pad',inplace=True)
test_data.lon.fillna(method='pad',inplace=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment