Skip to content

Commit

Permalink
Added Stephanes script to switch quouting
Browse files Browse the repository at this point in the history
  • Loading branch information
sambles committed Nov 28, 2024
1 parent 493ff13 commit a85ca9d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions utils/switch-quoting.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env python

import pandas as pd
import csv
from pathlib import Path

# add quoting switch => csv.QUOTE_MINIMAL // csv.QUOTE_ALL
oed_root_path = Path(Path(__file__).parent.parent, "OpenExposureData")
oed_files = list(oed_root_path.glob('*.csv'))

for filename in oed_files:
df = pd.read_csv(filename, dtype=str, na_values=[], keep_default_na=False)
df.to_csv(filename, index=False, quoting=csv.QUOTE_MINIMAL)

0 comments on commit a85ca9d

Please sign in to comment.