Skip to content

Commit

Permalink
remove redefining Series
Browse files Browse the repository at this point in the history
  • Loading branch information
yerbol-akhmetov committed Nov 8, 2024
1 parent 3e40712 commit f293e2c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions scripts/prepare_transport_data_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,8 @@ def download_CO2_emissions():
# Add ISO2 country code for each country
CO2_emissions = CO2_emissions.rename(columns={"Country Name": "Country"})
cc = coco.CountryConverter()
Country = pd.Series(CO2_emissions["Country"])
CO2_emissions["country"] = cc.pandas_convert(
series=Country, to="ISO2", not_found="not found"
CO2_emissions.loc[:, "country"] = cc.pandas_convert(
series=CO2_emissions["Country"], to="ISO2", not_found="not found"
)

# Drop region names that have no ISO2:
Expand Down

0 comments on commit f293e2c

Please sign in to comment.