Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix plots: Make load_over_time Function Dynamic #209

Open
tichmangono opened this issue Apr 22, 2023 · 0 comments
Open

Fix plots: Make load_over_time Function Dynamic #209

tichmangono opened this issue Apr 22, 2023 · 0 comments

Comments

@tichmangono
Copy link

Plotting with the load_over_time function was giving an error due to hardcoded indexes to select columns to be plotted. I suggest changes to make this part dynamic so it will plot only the numerical columns and only when there are numerical columns. Also wrote a comprehensive set of tests for the function with different test cases.

Problem code to reproduce error:

import gridstatus
import plotly.express as px
import pandas as pd

iso = gridstatus.PJM()
df = iso.get_load(date="today")

gridstatus.viz.load_over_time(df, iso="PJM")

The error seen:

`ValueError: Plotly Express cannot process wide-form data with columns of different type.`

Solution
Used pandas column datatype filters to identify numerical columns, then pass these to be plotted as the dependent variables (y)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant