-
-
Save sdhutchins/e831537c8c3916f32a4fd8a167e0e9ce 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
import yaml | |
import json | |
import pandas as pd | |
df = pd.DataFrame({'one': [1.0, 2.1, 3.2], 'two': [4.3, 5.4, 6.5]}) | |
with open('df.yml', 'w') as file: | |
yaml.dump({'result': json.loads(df.to_json(orient='records'))}, file, default_flow_style=False) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment