✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
⚡️ Concerned about the grid? Kyle Baranko teaches how to predicting peak loads using XGBoost. Register for the August webinar!

Backend Data Filtering in Dash

Hi, I have a histogram and would like to add data, but only if the value of the data < 0.

I’m using the following code to declare the data variable (x2) and then add it to the chart.

  x2=self.histf[self.input_hist].dropna() 
  fig.add_trace(go.Histogram(x=x2))

I’ve tried simply adding an “< 0” to the end of the first line, but that doesn’t filter the data.

Has anyone encountered a similar problem, and if so, might you know a solution?