<jupyter_start><jupyter_text>![image.png](attachment:image.png)<jupyter_code>df_confirmed = deaths_global_df.drop(['Province/State', 'Lat','Long'], axis=1)
df_confirmed.rename(columns={'Country/Region':'Country_Region'}, inplace = True)
df_confirmed
df_confirmed.to_csv("C:/Users/user/Documents/pandas_gogo/00_Material(Uploaded)/COVID-19-master/final_covid_data_for_graph.csv")<jupyter_output><empty_output><jupyter_text>https://public.flourish.studio/visualisation/7883558/<jupyter_code>country_info = pd.read_csv("C:/Users/user/Downloads/첫데이터분석_자료_저작권유념부탁_잔재미코딩_DaveLee_20211118/00_Material(Uploaded)/COVID-19-master/csse_covid_19_data/UID_ISO_FIPS_LookUp_Table.csv", encoding='utf-8-sig', keep_default_na = False, na_values='')
country_info
country_info = country_info[['iso2', 'Country_Region']]
country_info<jupyter_output><empty_output><jupyter_text>![image.png](attachment:image.png)<jupyter_code>country_info = country_info.drop_duplicates(subset='Country_Region', keep = 'first')
country_info
doc_final_country = pd.merge(country_info, df_confirmed, on='Country_Region')
doc_final_country
doc_final_country[doc_final_country['iso2'].isnull()]<jupyter_output><empty_output><jupyter_text>iso2가 결측인 행 제거<jupyter_code>doc_final_country = doc_final_country.dropna(subset=['iso2'])
doc_final_country

doc_final_country[doc_final_country['iso2'].isnull()]<jupyter_output><empty_output><jupyter_text>![image.png](attachment:image.png)<jupyter_code>doc_final_country['iso2'] = doc_final_country['iso2'].str.lower()
doc_final_country
doc_final_country.loc[262,'iso2'] = 'us'
doc_final_country<jupyter_output>C:\Users\user\anaconda3\lib\site-packages\pandas\core\indexing.py:1720: SettingWithCopyWarning: 
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead

See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
  self._setitem_single_column(loc, value, pi)<jupyter_text>국기 링크 만들기 함수<jupyter_code>def create_flag_link(row):
    flag_link = 'https://flagcdn.com/48x36/' + row + '.png'
    return flag_link

doc_final_country['iso2'] = doc_final_country['iso2'].apply(create_flag_link)
doc_final_country
cols = doc_final_country.columns.tolist()
cols
cols.remove('iso2')
cols.insert(1, 'iso2')
doc_final_country = doc_final_country[cols]
doc_final_country.head()
cols[1] = 'Country_Flag'
doc_final_country.columns = cols
doc_final_country.head()
doc_final_country.to_csv("C:/Users/user/Documents/pandas_gogo/00_Material(Uploaded)/COVID-19-master/final_covid_data_for_graph.csv")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13457249070631971, 'fraction_numerical': 0.021189591078066915, 'mean_word_length': 10.354430379746836, 'pattern_counts': {'":': 0, '<': 24, '<?xml version=': 0, '>': 24, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '626874', 'license': 'MIT', 'n_tokens_mistral': 1188, 'n_tokens_neox': 1062, 'n_words': 100, 'path': 'Corona_Confirmed_Death_Bar_Chart_Race_by_Jaeha.ipynb', 'repo_name': 'jaeha-soda/jaeha-soda.github.io', 'size': '2690'}