You Probably Don't Need to Switch from Pandas to Polars
datamethods.substack.com
datamethods.substack.com
Polars is a v2 of a dataframe API with a lot of thought put into offering a consistent experience. Variable names are seemingly regular across the board (eg no `sep` on this method, but `delimiter` here), no Numpy int nan baggage, and no silent data type conversions do a lot to improve the robustness of the code. That it is faster is nice, but a big shrug for my typical use cases.
The loss of the index is probably the right move - the implicit column has some subtle logic which I do not miss after switching to polars.
Source: over a decade of pandas experience. There are still a few idioms for which I do not have a good polars alternative, but nothing that is a deal breaker. The syntax is overall more verbose, but I am ok with it.
Which is to say, I have no real problems with the pandas API. In fact, if I could just transplant the polars strictness into pandas, that would let me keep the slightly more terse syntax.
I highly doubt this. Aside from dataframe generation and series assignment, almost everything in the API surface is different.
Strictness is also not something you can transplant easily. It is checking data types at the IR query planning level before you run the query and being able to resolve schema's independent of the data. In pandas schemas do depend on data within operations and therefore it isn't uncommon that data types change if data gets missing values nor can it check if a correct type is passed to an operation without running the compute.
Strictness, I understand you cannot just slap it in, more just an idle thought.