Comments (4)
thanks for the report
the docs say
Time zone of the resulting Datetime data type. Only takes effect if the output column is of type Datetime.
furthermore
In a future version of Polars, date_range will always return a Date.
so, this argument will just be removed from date_range
eventually
For now, the suggestion
Or at a minimum, there should be an error when time zones are specified and the output would be a date.
sounds good
from polars.
In your first example, you're using date_range
to construct a Datetime
series, which is explicitly warned against in the docs:
Deprecated since version 0.19.3: In a future version of Polars,
date_range
will always return aDate
. Please usedatetime_range()
if you want aDatetime
instead.
Both of your cases look correct to me. In the first case, New York uses EST, and your output is labeled EST.
The second "incorrect" case also look correct to me. When converting from datetime to date, the time zone is completely irrelevant: Dec 31 at 23:59 is still Dec 31 regardless of what time zone you're in. You're starting on Jan 1, incrementing by 2 days at a time, up until the 3rd. So you get the 1st and the 3rd.
Edit: I see, the error is that you expect a datetime here.
from polars.
@MarcoGorelli sounds good!
from polars.
This will all be taken care of in the scheduled deprecation. We should not make changes to deprecated functionality if not absolutely necessary.
from polars.
Related Issues (20)
- Support array datatypes in read_csv HOT 2
- .str.contains_which(terms_list) HOT 1
- pl.lit does not use the correct signed integer remainder HOT 5
- Support `concat()` with `how="diagonal"` for `Object` type
- Implement `sum` for decimal type. HOT 2
- Rust streaming feature fails to compile HOT 1
- Strict cast of Duration/Datetime to higher precision may overflow
- pathological parquet reading performance. HOT 9
- from_arrow removes all the columns from length-0 RecordBatches
- Misleading error message when passing a DataFrame to assert_series_equal, or a Series to assert_frame_equal HOT 1
- Cannot collect unnested struct value after applying cut on LazyFrame combined with .over expression. HOT 1
- StringCacheMismatchError when comparing empty pl.Enum and pl.Enum([]) Series with string cache enabled HOT 2
- cannot add `&std::string::String` to `std::string::String` when `use use polars::prelude::*;` HOT 2
- DataFrame.write_json does not convert all rows HOT 2
- Handle nulls in df.corr()
- Update join strategy in the user guide
- `uv` break local `make requirements` where using `pip` doesn't. HOT 1
- Parity in methods between `polars.Series` and `polars.Expr` HOT 3
- A method to get arrow RecordBatch from Polars Dataframe for polars-rs Rust HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from polars.