functime-org / functime

Time-series machine learning at scale. Built with Polars for embarrassingly parallel feature extraction and forecasts on panel data.
https://docs.functime.ai
Apache License 2.0
971 stars 52 forks source link

fix: `TypeError: the truth value of a DataFrame is ambiguous` #192

Closed baggiponte closed 2 months ago

baggiponte commented 2 months ago

This error was raised because of this:

fig = make_subplots(rows=n_rows, cols=n_cols, subplot_titles=entities)

Turns out, we just needed this:

fig = make_subplots(rows=n_rows, cols=n_cols, subplot_titles=entities.to_list())
vercel[bot] commented 2 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
functime-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 16, 2024 6:32pm
baggiponte commented 2 months ago

Ciao @miroslaavi! I opened this to fix an issue reported by @StuffbyYuki raised. I think your PR does not make this change: would you mind reviewing this and re-base your current one?

EDIT: sorry, your PR basically addressed this (issue #179). Would you be ok with merging this, closing the issue, and marking your PR as a refactoring + tests and enhancements?

miroslaavi commented 2 months ago

Hey! Yeah in the PR this issue is addressed but slighlty differently as there is a function '_prepare_data_for_subplots' which prepares the data for all the subplotting functions. I think the only difference is just that in the PR the type will be pl.Series and not a list type.

Im traveling now, but will have a look in the upcoming days. :)

baggiponte commented 2 months ago

Actually let's forget about this, I realised we should just stick to your PR!