Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix-data][s] Fixing up the data issue format - #34 #35

Merged
merged 1 commit into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion data/code-list.csv
Original file line number Diff line number Diff line change
Expand Up @@ -61393,7 +61393,6 @@ x,ZA,NGQ,Port of Ngqura,Port of Ngqura,EC,XX,1----6--,2307,,3346S 02540E,
,ZW,VFA,Victoria Falls,Victoria Falls,,AI,---4----,9501,,,
,ZW,ZMZ,Zimbabwe,Zimbabwe,MV,RL,1-3-----,1401,,2016S 03055E,
,ZW,ZVS,Zvishavane,Zvishavane,MI,RL,--3-----,1207,,2020S 03002E,
Change,Country,Location,Name,NameWoDiacritics,Subdivision,Function,Status,Date,IATA,Coordinates,Remarks
,AO,FBY,Farta Bay,Farta Bay,,1-------,RQ,0901,,1237S 01312E,
,AO,FLT,Futila Terminal,Futila Terminal,,1-------,RQ,0901,,0527S 01211E,
,AO,GIM,Gimboa,Gimboa,,1-------,RL,1107,,0732S 01210E,
Expand Down
3 changes: 3 additions & 0 deletions scripts/prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ def process(extracted_files):
codelist_df = pd.DataFrame(codelist_list) #)=pd.concat(codelist_list)
codelist_df = codelist_df.reindex(columns=['Change', 'Country', 'Location', 'Name', 'NameWoDiacritics', 'Subdivision',
'Status', 'Function', 'Date', 'IATA', 'Coordinates', 'Remarks'])
# Keep only rows where 'Country' values are empty, 1 character, or exactly 2 characters
codelist_df = codelist_df[codelist_df['Country'].str.len().fillna(0).between(0, 2)]
codelist_df.to_csv(f"data/code-list.csv", index=False)

alias_df.to_csv(f"data/alias.csv", index=False)
print("Processed and saved UNLOCODE files")
return
Expand Down