Skip to content

Commit

Permalink
Black reformating
Browse files Browse the repository at this point in the history
  • Loading branch information
romainsacchi committed Feb 22, 2024
1 parent 20c2747 commit 25d5020
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions dev/convert_missings.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,20 @@
import yaml

# Load the CSV file
file_path = 'missing_classifications.csv'
file_path = "missing_classifications.csv"
data = pd.read_csv(file_path)

# Convert dataframe to a list of tuples, matching the desired output structure
data_tuples = [{tuple(x): "Other transportation support activities"} for x in data.to_numpy()]
data_tuples = [
{tuple(x): "Other transportation support activities"} for x in data.to_numpy()
]

# Prepare the data in the specified YAML format with the custom tag
yaml_data = yaml.dump(data_tuples, default_flow_style=False, allow_unicode=True, sort_keys=False)
yaml_data = yaml.dump(
data_tuples, default_flow_style=False, allow_unicode=True, sort_keys=False
)

# Save the YAML data to a file
yaml_file_path = 'converted_yaml.yaml'
with open(yaml_file_path, 'w') as file:
file.write(yaml_data)
yaml_file_path = "converted_yaml.yaml"
with open(yaml_file_path, "w") as file:
file.write(yaml_data)

0 comments on commit 25d5020

Please sign in to comment.