-
How exactly does |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
If you can provide some code that reproduces this, especially wrt a comparison to datashader, this would be a very valuable bug report! Thanks. |
Beta Was this translation helpful? Give feedback.
-
Perhaps I'd need a smaller data set that would be updated as we navigate through the data somehow. Thought from datetime import date, datetime
import numpy
import polars
import perspective
# works great with 10_000
ENTRIES = 10_000_000
df = polars.DataFrame({
"col1_int": numpy.arange(ENTRIES),
"col2_int": numpy.arange(ENTRIES),
})
# this takes +10s
table = perspective.Table(df.to_pandas())
# this takes +10s
view = table.view()
# this takes +10s
df_view = view.to_df()
# another +10s
df_view = view.to_df()
# unusable (no data displayed)
perspective.PerspectiveWidget(df_view)
# datashader version
import hvplot
import hvplot.pandas # noqa
df.to_pandas().hvplot(rasterize=True) |
Beta Was this translation helpful? Give feedback.
-
@jmakov The widget is unusable because you're using it incorrectly (and it prints an error to this effect # Don't pass a `View` here
perspective.PerspectiveWidget(table) It's slow because you are doing processing gymnastics on it before loading it. Use an Apache Arrow if you want the fastest loading time possible, not a DataFrame: After the table is loaded, the performance differences evaporate: |
Beta Was this translation helpful? Give feedback.
-
Thanks for the quick feedback. It is a bit strange though that somebody else than the OP decides when the question was answered and which answer was the solution... |
Beta Was this translation helpful? Give feedback.
@jmakov The widget is unusable because you're using it incorrectly (and it prints an error to this effect
PerspectiveError: Only 'Table' or data can be loaded
, so I'm not sure why you're asking about it here):It's slow because you are doing processing gymnastics on it before loading it. Use an Apache Arrow if you want the fastest loading time possible, not a DataFrame:
After the table is loaded, the performance differences evaporate: