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

DateTime is not recognised in polars.DataFrame #961

Closed
OLarionova-HORIS opened this issue Dec 13, 2023 · 0 comments
Closed

DateTime is not recognised in polars.DataFrame #961

OLarionova-HORIS opened this issue Dec 13, 2023 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@OLarionova-HORIS
Copy link
Contributor

Automatic detection of DateTime series does not work on polars.DataFrame.

Example:

import datetime as dt
import numpy as np
from lets_plot import *

LetsPlot.setup_html()

n = 31
np.random.seed(42)

df = pl.DataFrame({
    'd': [dt.datetime(2021, 1, 1) + dt.timedelta(days=d) for d in range(n)],
    't': np.random.normal(loc=-5, scale=6, size=n)
})

ggplot(df, aes('d', 't')) + geom_bar(stat='identity')

Output:
Screenshot 2023-12-13 at 12 41 08

Expected - is the same as the result of using pandas.DataFrame:

ggplot(df.to_pandas(), aes('d', 't')) + geom_bar(stat='identity')
Screenshot 2023-12-13 at 12 48 45
@alshan alshan added this to the New milestone Dec 18, 2023
@alshan alshan modified the milestones: New, 2024Q1 Dec 29, 2023
@alshan alshan added the bug Something isn't working label Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants