Spaces:
Build error
Build error
Cast metric data to float to fix plot.
Browse files
app.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
import os
|
| 2 |
import gradio as gr
|
| 3 |
import plotly.express as px
|
|
|
|
| 4 |
|
| 5 |
from utils import duckdb_queries as dq
|
| 6 |
from utils.gradio import get_window_url_params
|
|
@@ -20,6 +21,8 @@ def toggle_metric_definition_box(text_input):
|
|
| 20 |
return None
|
| 21 |
|
| 22 |
def make_timeseries_plot(df):
|
|
|
|
|
|
|
| 23 |
return px.line(df, x='Year', y='Score (Area * Value)', markers=True)
|
| 24 |
|
| 25 |
with gr.Blocks() as demo:
|
|
|
|
| 1 |
import os
|
| 2 |
import gradio as gr
|
| 3 |
import plotly.express as px
|
| 4 |
+
import pandas as pd
|
| 5 |
|
| 6 |
from utils import duckdb_queries as dq
|
| 7 |
from utils.gradio import get_window_url_params
|
|
|
|
| 21 |
return None
|
| 22 |
|
| 23 |
def make_timeseries_plot(df):
|
| 24 |
+
for col in df.columns:
|
| 25 |
+
df[col] = pd.to_numeric(df[col], errors='ignore')
|
| 26 |
return px.line(df, x='Year', y='Score (Area * Value)', markers=True)
|
| 27 |
|
| 28 |
with gr.Blocks() as demo:
|