Skip to content

Why are Polars dataframes converted to Pandas? #23

@bmaclin58

Description

@bmaclin58

I see a lot of indicators are converted to Pandas before any calculations are done on them. For example in z_score_predictive_zones.py
is_polars = isinstance(df, PlDataFrame)
if is_polars:
pdf = df.to_pandas()
else:
pdf = df

is there a reason for this?

When trying to apply the calculations at scale for multiple tickers or for higher interval charts (1m, 3m etc) the speed and efficiency of Polars is going to beat Pandas. If you need it for output so you have cross compatibility with Pandas frameworks, you can covert the dataframe at the end, or pass the series back as the specific dataframe library needed. Is there a reason I am missing that the calculations are done in Pandas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions