|
Chin Strap posted:It isn't as good though StumblyWumbly posted:I've found that Plotly makes better graphs more easily compared to Matplotlib. Matplotlib's strength is its weakness; it can do everything. But its API can be cumbersome because of that. I like Seaborn for making the most common types of plots. It's nice because it's a wrapper around Matplotlib, so you can still add extra fancy customizations to its Figure objects if you want to.
|
# ¿ Oct 19, 2023 01:35 |
|
|
# ¿ May 15, 2024 06:30 |
|
Related to all this pandas discussion: what's y'all's take on the future of pandas now that polars exists? I know that polars doesn't yet do everything that pandas does (though I'm not an expert on the details here), but it does a hell of a lot, and with a nicer API and vastly more speed. I'll be curious to see polars' impact over time given that it seems to be surging in popularity. Personally, I've switched over to polars when I can, though I often still bang something out in pandas when I need something quick and the execution speed differences don't really matter.
|
# ¿ Oct 20, 2023 11:40 |
|
Chin Strap posted:I think "nicer API" is a bit of a stretch. Haven't used it because at Google we don't really have approved Rust support yet (cross language compilation with all the custom things we do takes a lot of support and it is still definitely alpha) but it looks more like a thin layer over SQL style operations than the pandas library. Never felt super pythonic to me to have to write something like (stolen from reddit)
|
# ¿ Oct 21, 2023 02:12 |
|
RealPython has a good article on list comprehensions: https://realpython.com/list-comprehension-python/ (Their stuff is usually good, FYI)
|
# ¿ Oct 21, 2023 13:47 |
|
They're making it so you can turn off that "feature" pretty soon. No, Excel, I did not mean "October 1, 1950" when I entered "10-50"
|
# ¿ Nov 8, 2023 00:46 |
|
When plotting stuff with Matplotlib/Seaborn, is there a simple way to ensure that the legend always winds up in the same spot outside of the plot(s)? I generally use the loc='upper right', bbox_to_anchor=(X, 1) arguments to get the legend outside and to the right of the plots, where X is some number like 1.2 or 1.4, but then I need to keep manually tweaking X to get the legend exactly where I want it (with its top roughly aligned to the top of the plots, and a bit of whitespace between the right border of the plots and the left border of the legend). This of course involves constantly regenerating the plot(s), which may or may not be fast depending on what I'm doing. Surely there is a less annoying way to do this?
|
# ¿ Dec 5, 2023 09:05 |
|
The official solution is really verbose, non-Pythonic code, and the verbosity doesn't add anything useful like error checking. I don't think you're missing anything. E: It's possible the official solution is written that way for teaching purposes, since each step in the logic is explicit. Like, by taking 4 lines of code to get "front," that avoids needing to know that if you slice a string to a higher end index than the string's length, you just get whatever's in the string. Zugzwang fucked around with this message at 06:36 on Feb 15, 2024 |
# ¿ Feb 15, 2024 06:30 |
|
PyArrow has a Parquet module. You might try that if Polars is bring uncooperative.
|
# ¿ Feb 21, 2024 21:49 |
|
QuarkJets posted:Hmm it looks like applying lru_cache to methods prevents instances of that class from ever getting garbage collected, that's a bummer. In any case, that certainly explains weird bugs I've run into when using lru_cache.
|
# ¿ Mar 11, 2024 04:00 |
|
|
# ¿ May 15, 2024 06:30 |
|
DuckDB uses SQL to manipulate dataframes and is insanely performant. It interfaces nicely with pandas too.
|
# ¿ Mar 23, 2024 13:59 |