-
-
Save ericness/ea9b73d677509f3d3bed5ea9371ffc99 to your computer and use it in GitHub Desktop.
Transform CSV file into JSON string
This file contains hidden or 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
def transform_to_json(row): | |
passenger_dict['Survived'] = row['Survived'] | |
ticket_dict['Pclass'] = row['Pclass'] | |
ticket_dict['Fare'] = row['Fare'] | |
passenger_dict['Ticket'] = ticket_dict | |
return json.dump(passenger_dict) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment