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

timestamp column is written as date column #1441

Closed
romanovacca opened this issue Sep 25, 2021 · 1 comment
Closed

timestamp column is written as date column #1441

romanovacca opened this issue Sep 25, 2021 · 1 comment

Comments

@romanovacca
Copy link
Contributor

Are you using Python or Rust?

Python

Describe your bug.

When I have a dataframe with a timestamp column such as : 2021-01-01 00:15:00 , where the column type is Date64,
if I then use the df.to_csv() function, the resulting csv file only shows 2021-01-01, without the time.

What are the steps to reproduce the behavior?

df = pl.DataFrame(
        {
            "timestamp": ["2021-01-01 01:00:00","2021-01-01 02:00:00","2021-01-01 03:00:00"],
            "open": [100] * 3,
            "close": [110] * 3,
            "high": [120] * 3,
            "low": [99] * 3,
        }
    )
df["timestamp"] = df['timestamp'].str.strptime(pl.datatypes.Date64, "%Y-%m-%d %H:%M:%S")
df.to_csv("testing.csv")

What is the expected behavior?

I woudl expect it to be written with the time included.

@ritchie46
Copy link
Member

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

2 participants