-
-
Save BinarySpoon/d23c5d42fe5c7331a313a0fe35bc2f2b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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