Python for Data Analysis, 3rd Edition
wesmckinney.com
wesmckinney.com
I would like to see some of Wes’ cautionary tales included into the book. Pandas feels so magical at times that you can uses it to solve anything. That can create problems. Ideas like this should be some appendix to the book.
https://wesmckinney.com/blog/apache-arrow-pandas-internals/
Lots of tools in the data space. It feels like choosing JS web front ends. I use pandas quite a lot but less frequently, as my data has gotten larger I turn to spark more. I’m also impressed by the work DuckDB is doing.
[0] -- https://www.pola.rs/
If you use an r5d.24xlarge-like[1] instance, you can skip spark/dask for most workflows as 768 GB is plenty enough. On top of that, polars will efficiently use the 96 available cores when you are computing your join, groupby, etc.
Also polars is getting more and more popular[2]
[0] -- https://h2oai.github.io/db-benchmark/ [1] -- https://aws.amazon.com/fr/ec2/instance-types/c6a/ [2] -- https://star-history.com/#pola-rs/polars&Date
Polars runs orders of magnitudes faster than pandas does. Which means EDA can be completed quicker.
A statistician/data scientist wrangling data and making plots would not have cared whether loading a CSV file takes one second or one microsecond, because they may only do it a handful of times for a project.
A data engineer has different requirements and expectations. They may need to implement an operational component that process CSV files repeatedly for billions of time a day.
If your use case is the latter, then pandas is probably not for you.
I've definitely procrastinated doing some analyses or turning prototypes into dashboards because of the potential for small slowdowns to turn into big slowdowns, so it's nice to have other options available. I'm very interested in Dask but have also been apprehensive about doing something stupid and incurring a huge bill by failing to think through my problem sufficiently.
Polars excels when pandas operations take 30 seconds or a minute to complete. Bringing that time down to the second or ms mark is really amazing.
IME xarray and pandas have to be used together. Neither can do what the other does. (Well, some people try to use pandas for stuff that should be numpy or xarray tasks.)
I still use pandas for tabular data, but anytime I have to deal with ND data, xarray is a lifesaver. No more dealing with raw, unlabeled 5-D numpy arrays, trying to remember which dimension is what.
[0] https://modin.readthedocs.io/en/stable/
I don’t have much experience with this though.
Python for Data Analysis – A Critical Line-By-Line Reivew - https://news.ycombinator.com/item?id=15786977 - Nov 2017 (3 comments)
Ask HN: What are the best resources to learn Python for Data Analysis - https://news.ycombinator.com/item?id=12775775 - Oct 2016 (15 comments)
Python for Data Analysis - https://news.ycombinator.com/item?id=4697665 - Oct 2012 (28 comments)
Escaping The Walled Garden of Enterprise Analytics Using R and Python - https://news.ycombinator.com/item?id=4624186 - Oct 2012 (1 comment)
Python for Data Analysis (new O'Reilly book from creator of Pandas) - https://news.ycombinator.com/item?id=4020187 - May 2012 (57 comments)
Also:
Wes McKinney, the developer of Pandas - https://news.ycombinator.com/item?id=15878616 - Dec 2017 (50 comments)
Pandas was a great step on the path to making Python a decent data analysis language, Wes is smarter than me, I never could have built it, but it's time to move on.
Right now it supports a decent number of verbs + SQL generation. I tried to break down why R users find pandas difficult in an RStudioConf talk last year[2].
Between siuba and tools like polars and duckdb, I'm hopeful that someone hits the data analysis sweet spot for python in the next couple years.
Just one question, this runs over pandas? It's possible to get the pandas syntax like dbplyr gives the SQL query syntax?
https://siuba.readthedocs.io/en/latest/intro.html#Working-wi...
You can use the verbs collect() and show_query() like in dbplyr.
If you DM me on twitter, would love to set up time to hear about your work / walk through siuba!
See e.g. https://ibis-project.org/
You're "waiting" for him to personally call you or something?
Also, pandas was purpose built for a pretty specific domain of financial timeseries and cross-sectional data analysis at a time when the python ecosystem was much younger and very different from today.
It's not his fault it became so wildly successful! (actually it was - it's a great piece of sofware :))
I’m pretty rusty at programming having last studied formally algorithms, data structures, oop in c++ 15 years ago in an undergrad compsci program.
I’ve done mostly sql coding and database work ever since but need to level up my skill set.
Usually slowness in Pandas will be if you start doing non vector things.
Whenever you catch yourself writing a loop in Pandas you know you've gone the wrong way.
I too use Python extensively (with Pandas among other things) and usually Pandas is perfectly fine. (havent gone over 64GB memory usage yet)
I consider Pandas to be Numpy with benefits (methods) - since Pandas dataframe is basically just a collection of Numpy arrays. Those are about as close to C type arrays you can get in Python.
The only practical problems have been with regressions among supporting libraries such as pyarrow not playing nice with numpy when working with parquet files.
Warning: This link will open a Jupyter notebook in your browser:
https://jupyter.org/try-jupyter/lab/
It's worked pretty smoothly for me so far. I can't vouch for how it handles big data sets or obscure libraries, but seems like a pretty good starting point for those who are learning Python. It has become how I prefer to share simple notebooks with colleagues too.But either of these options is nice for dealing with the situation of getting a beginner through the Python installation process. Another is WinPython, which is my preferred environment for local installation.