datasets / un-locode

United Nations Codes for Trade and Transport Locations (UN/LOCODE) and Country Codes
https://datahub.io/core/un-locode
146 stars 56 forks source link

CSV contains two lists with two different formats #34

Closed dwaam closed 1 week ago

dwaam commented 2 weeks ago

Hi,

There is an issue with the CSV export for resource code-list: Header: Change,Country,Location,Name,NameWoDiacritics,Subdivision,Status,Function,Date,IATA,Coordinates,Remarks for around 61K lines

then a new header appears at line 61396 Change,Country,Location,Name,NameWoDiacritics,Subdivision,Function,Status,Date,IATA,Coordinates,Remarks

Same data but two header are switched.

Is there a way to fix that please?

I see that it is directly the data file which is corrupted: https://raw.githubusercontent.com/datasets/un-locode/refs/heads/main/data/code-list.csv

Thank

sabas commented 2 weeks ago

Good catch! @gradedSystem please check Thanks

gradedSystem commented 2 weeks ago

@sabas should be fixed with the latest PR https://github.com/datasets/un-locode/pull/35

dwaam commented 2 weeks ago

Hi, Thanks for the PR, but I don't think the data is fixed. The second header is removed, but the problem is that two columns are switched, so all the next data should have the two columns switched back no?

gradedSystem commented 2 weeks ago

Hi @dwaam can you give me an example, cause i didnt seem to get it

dwaam commented 2 weeks ago

Of course

image

As you can see here: ,ZW,ZVS,Zvishavane,Zvishavane,MI,RL,--3-----,1207,,2020S 03002E, You have status RL then function --3-----. Then, those two columns are switched ,AO,FBY,Farta Bay,Farta Bay,,1-------,RQ,0901,,1237S 01312E, You have 1------- function, then RQ status

gradedSystem commented 2 weeks ago

ok now i think i understood @dwaam

gradedSystem commented 2 weeks ago

@dwaam I added function to fix this issue raised a PR waiting for an approve

dwaam commented 2 weeks ago

Alright thanks, yep, now the data seems all good in the csv thanks ;)