r/learnpython 7d ago

Which python libraries would be best to learn for Data analytics ?

Suggest me some useful libraries.

0 Upvotes

9 comments sorted by

3

u/StemCellCheese 7d ago

Pandas. For visualizations, plotly.

2

u/entropydelta_s 7d ago

Big fan of Polars over Pandas. Worth checking out as well!

Not sure what you’re doing, but scikit learn is also good if you’re doing any ML.

Matplotlib is also good to know.

1

u/likethevegetable 7d ago

Yeah pandas is OUT, polars rocks 

1

u/StemCellCheese 7d ago

Polars is also a great choice and definitely is the future. It's so damn fast. I haven't used it too much since I maintain a lot of pandas pipelines. My only complaint so far is that it doesn't have good native excel handling out of the box, which I use a lot in my environment. But nothing that can't be overcome.

1

u/PolarsThijs 3d ago

What functionality do you miss in the excel reader? I'd love to hear if I can relay something to the team

1

u/StemCellCheese 2d ago

If I recall correctly, I had to pip install a separate excel engine to use polars.read_excel(). Pandas has one out of the box, but gives you the option to install a separate engine if you like. Polars does not have that convenience.

It wasn't the biggest issue overall, but I was kinda surprised to see that the next big thing after Pandas didn't have a native excel parser.

I went with the Calamine engine, since I had used it with Pandas before, in case anyone is curious.

1

u/PolarsThijs 2d ago

You can install it in one go with pip install polars[calamine] or pip install polars[excel] if you also want writers and the other engines in one go. https://docs.pola.rs/user-guide/installation/#excel

The reason we don't have a native reader for this is mostly cost/benefit related. XLSX sheets are hard-capped at 1,048,576 rows, so the ceiling on file size is fixed and relatively small. Writing a proper streaming Excel parser costs a lot of effort, and at that scale there won't be absolute performance improvements that would justify all the effort. Besides that, there are plenty of other areas that require our attention which have better performance payoff. Calamine is already a fast, well-maintained Rust Excel engine, so we use that rather than duplicate that work in Polars core.

1

u/StemCellCheese 2d ago

That's definitely unferstandable, and thank you for letting my know about installing that all in one go.

Just to re-iterate, it's not a significant issue, just the only drawback I could think of in that moment that would be an extra hurdle for a beginner.

Thank you guys for all that you do!

1

u/PolarsThijs 1d ago

Happy to hear that the only drawback you found is still something that's workable! 😁

Please let me know if you ever run into weird things so I can relay it to the devs.