Skip to content

Commit

Permalink
Fix bug in basic kpi plot with amount of lines
Browse files Browse the repository at this point in the history
  • Loading branch information
alephcero committed Nov 22, 2024
1 parent d0d0525 commit 6449eb9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions urbantrips/viz/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -2625,13 +2625,14 @@ def plot_basic_kpi_wrapper():
q = """
select *
from basic_kpi_by_line_hr
where dia = 'weekday'
where dia = 'weekday';
"""

if lineas_principales != "All":
q += f"limit {lineas_principales}"
kpi_data = pd.read_sql(q, conn_data)

q += ";"
if lineas_principales != "All":
top_lines = list(kpi_data.id_linea.value_counts().index[:lineas_principales])
kpi_data = kpi_data.loc[kpi_data.id_linea.isin(top_lines)]

kpi_data = pd.read_sql(q, conn_data)

Expand Down

0 comments on commit 6449eb9

Please sign in to comment.