File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -58,13 +58,15 @@ def handle_error(self, response):
5858 def extract_country_data (self , data ):
5959 country_list = []
6060 for country_data in data :
61+ if not country_data ["Don_Code" ] or not country_data ["CON_country" ]:
62+ continue
6163 country_code = [country_data ["Don_Code" ].strip (), country_data ["CON_country" ]]
6264 country_list .append (country_code )
6365
6466 country_table = pd .DataFrame (country_list , columns = ["Country Code" , "Country" ]).drop_duplicates (
6567 subset = ["Country Code" ], keep = "last"
6668 )
67- country_table = country_table .replace (to_replace = "None" , value = np .nan ).dropna ()
69+ country_table = country_table .replace (to_replace = [ "None" , "" ] , value = np .nan ).dropna ()
6870 return country_table
6971
7072 def fetch_country_documents (self , api_key , country_ns_code ):
You can’t perform that action at this time.
0 commit comments