Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -5,6 +5,7 @@ import requests
|
|
5 |
import plotly.express as px
|
6 |
import matplotlib.font_manager as fm
|
7 |
import matplotlib as mpl
|
|
|
8 |
|
9 |
# Define URLs
|
10 |
urls = {
|
@@ -18,7 +19,7 @@ def load_data():
|
|
18 |
dataframes = {}
|
19 |
for name, url in urls.items():
|
20 |
response = requests.get(url)
|
21 |
-
df = pd.read_csv(
|
22 |
df = df.fillna(0) # Replace missing values with 0
|
23 |
dataframes[name] = df
|
24 |
return dataframes
|
|
|
5 |
import plotly.express as px
|
6 |
import matplotlib.font_manager as fm
|
7 |
import matplotlib as mpl
|
8 |
+
import io # Import io to use StringIO
|
9 |
|
10 |
# Define URLs
|
11 |
urls = {
|
|
|
19 |
dataframes = {}
|
20 |
for name, url in urls.items():
|
21 |
response = requests.get(url)
|
22 |
+
df = pd.read_csv(io.StringIO(response.text)) # Use io.StringIO instead of pandas.compat
|
23 |
df = df.fillna(0) # Replace missing values with 0
|
24 |
dataframes[name] = df
|
25 |
return dataframes
|