Roberta2024 commited on
Commit
857d8ed
·
verified ·
1 Parent(s): 1cc4671

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
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(pd.compat.StringIO(response.text))
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