RoyAalekh commited on
Commit
f2d32d6
·
verified ·
1 Parent(s): 421b826

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -13,14 +13,14 @@ from plotting import (
13
 
14
  def load_data_in_chunks(file_path, selected_columns, start_date=None, end_date=None, chunksize=10000):
15
  # Load the entire header to get multi-level column names
16
- header = pd.read_csv(file_path, nrows=0, header=[0, 1, 2])
17
 
18
  # Filter the required columns including datetime
19
  columns = [col for col in header.columns if col[2] in selected_columns]
20
 
21
  chunks = []
22
  for chunk in pd.read_csv(file_path, chunksize=chunksize, header=[0, 1, 2], index_col=0, parse_dates=True):
23
- # Assign multi-level columns
24
  chunk.columns = header.columns
25
 
26
  # Filter the necessary columns
@@ -62,6 +62,11 @@ heatmap_temperature = pn.widgets.Checkbox(
62
  # Create a loading spinner
63
  loading_spinner = pn.indicators.LoadingSpinner(width=50, height=50)
64
 
 
 
 
 
 
65
  @pn.depends(
66
  inverter_ids.param.value,
67
  plot_power_curves.param.value,
 
13
 
14
  def load_data_in_chunks(file_path, selected_columns, start_date=None, end_date=None, chunksize=10000):
15
  # Load the entire header to get multi-level column names
16
+ header = pd.read_csv(file_path, nrows=0, header=[0, 1, 2], index_col=0)
17
 
18
  # Filter the required columns including datetime
19
  columns = [col for col in header.columns if col[2] in selected_columns]
20
 
21
  chunks = []
22
  for chunk in pd.read_csv(file_path, chunksize=chunksize, header=[0, 1, 2], index_col=0, parse_dates=True):
23
+ # Assign multi-level columns (excluding the index)
24
  chunk.columns = header.columns
25
 
26
  # Filter the necessary columns
 
62
  # Create a loading spinner
63
  loading_spinner = pn.indicators.LoadingSpinner(width=50, height=50)
64
 
65
+ @pn.depends(
66
+ inverter_ids.param.value,
67
+ plot_power_curves.param.value,
68
+ plot_temperature_curves.param.value,
69
+ )
70
  @pn.depends(
71
  inverter_ids.param.value,
72
  plot_power_curves.param.value,