Browse Source

Update 'crawl_electricity.py'

天问 2 years ago
parent
commit
541394246f
1 changed files with 1 additions and 1 deletions
  1. 1 1
      crawl_electricity.py

+ 1 - 1
crawl_electricity.py

@@ -34,7 +34,7 @@ for i, country in enumerate(countries["stats"]):
     df = pd.DataFrame(res.json())
     try:
         data = df[["year"]].copy()
-        data["country"] = df["value"]
+        data[country] = df["value"]
         data.set_index("year", inplace=True)
         dataList.append(data)
         print(f"{i}")