Last active
November 15, 2022 18:57
-
-
Save jay-johnson/23e8ac8a8a575c76eeb04a4c6c6a7bb7 to your computer and use it in GitHub Desktop.
Polars Rust - Convert DataFrame Epoch Column in Milliseconds (i64) to a UTC date-formatted string
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let date_utc_str_s: Series = Series::new( | |
"date_utc_str", | |
df | |
.column("date") | |
.unwrap() | |
.cast(&DataType::Datetime( | |
polars::datatypes::TimeUnit::Milliseconds, | |
None)) | |
.unwrap() | |
.strftime("%Y-%m-%dT%H:%M:%SZ") | |
.unwrap()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment