News for hackers. Stuff that matters.
Re:Comprehensive Guide on Data Visualization with Pandas by lawlorino on Monday September 16, 2019 @10:46AM (#20984566)
I really am not sure how "comprehensive" I would call this, after glancing over it it looks like one of the million currently existing basic pandas plotting guides.
Re:Comprehensive Guide on Data Visualization with Pandas by abhishekjha on Monday September 16, 2019 @10:59AM (#20984718)
What should one do if after following those million guides it still doesn’t stick? I always end up googling what I want and hit SO. Is there something wrong with me or does numpy and pandas seem more difficult than they should be?
Re:Comprehensive Guide on Data Visualization with Pandas by _coveredInBees on Monday September 16, 2019 @11:23AM (#20984967)
The pandas api is a mess and that's why it feels that way. It is a great tool, and very powerful, but boy does it make the user's life difficult with a pretty convoluted API that makes it very hard to automatically discover functionality. As others have said, unless you use it all the time, you're essentially in for a bad time that involves lots of Googling and SO browsing even to get basic things done in pandas. I say this as someone who had developed a few smaller projects that utilize pandas extensively, so I'm not just criticizing it without having used it.
Re:Comprehensive Guide on Data Visualization with Pandas by EForEndeavour on Monday September 16, 2019 @02:08PM (#20986915)
As a daily pandas user for a couple years, I agree that the API is rough in places, though the official docs are extremely helpful. Also, the Stack Overflow community has come up with some helpful "missing manual" writeups, such as "Pandas Merging 101" https://stackoverflow.com/questions/53645882/pandas-merging-...

API pain points off the top of my head:

- There are both `pivot` and `pivot_table` methods which behave slightly differently. I'd have to look up why `pivot` exists; I've learned simply to reach for `pivot_table` every time, since it aggregates more flexibly.

- The dreaded SettingWithCopyWarning is a huge pain for new pandas users, and simply should not exist in any mature data analysis software.

- Unlike in SQL, in pandas you can take a data table (a DataFrame) and group it by one or more columns without immediately specifying an aggregation function. The result of this `groupby` operation is a "groupby object", which contains all the information of the input DataFrame, but behaves completely differently from a DataFrame. By contrast, in R's tidyverse, my understanding is that when you group a tibble (the tidyverse's data table), the result is still a tibble, just grouped.

- It took a while to mentally sort out the similarities and differences of merge, join, append, and concatenate. In practice, I almost always reach for `merge` or `concat`.

Re:Comprehensive Guide on Data Visualization with Pandas by lawlorino on Monday September 16, 2019 @11:05AM (#20984782)
I really wouldn't worry about it - I've been using Python for data work for the last 5 years or so and I have to look stuff all the time. Eventually the basic stuff sticks but it's like any kind of coding, I don't think anyone ever hits the point where they hardly ever have to Google stuff.

One useful tip I can suggest is to create a repo for useful code snippets, so if you ever find yourself doing something new that you think you might need again, just spend a bit of time commenting and describing it and add it to the repo. That way instead of having to spend time searching you'll hopefully remember doing it before and be able to find it easily.

Re:Comprehensive Guide on Data Visualization with Pandas by Foivos on Monday September 16, 2019 @11:59AM (#20985411)
After googling the same things every other week, I started using a snippets application (in my case it is SnippetsLab) where I wrote a nice description and keywords for every snippet. Life is so much easier that way.
Re:Comprehensive Guide on Data Visualization with Pandas by xapata on Monday September 16, 2019 @11:10AM (#20984839)
Back in the old days, experts collected reference manuals. Googling things is the same as flipping through the pages of a manual.
Re:Comprehensive Guide on Data Visualization with Pandas by Foivos on Monday September 16, 2019 @12:03PM (#20985460)
It is possible to do the same things in Pandas is many different ways. It is good to have this flexibility, but it is confusing for new users. On top of that the bracket operator ([) is overloaded in many ways.

Things started to make sense after I read a very good book on Pandas[1]. Reading a book is better than reading blog posts, because it is consistent. In contrast, reading small tutorials for every little thing is confusing, because every blog post is using a different way to do the same thing.

[1] https://github.com/jakevdp/PythonDataScienceHandbook

Re:Comprehensive Guide on Data Visualization with Pandas by squaresmile on Monday September 16, 2019 @11:41AM (#20985172)
I suggest looking into matplotlib structures: figures and axes. I think this article [0] is pretty good at detailing how to work with them. They definitely can be confusing but I think most can grasp what to use after reading the article.

[0] http://jonathansoma.com/lede/algorithms-2017/classes/fuzzine...

Re:Comprehensive Guide on Data Visualization with Pandas by BeetleB on Monday September 16, 2019 @11:08AM (#20984815)
>Is there something wrong with me or does numpy and pandas seem more difficult than they should be?

If you're only an occasional user, this will be your life forever. My experience with pandas is that if you use it heavily for 3 months, then things start to "stick" and you need to look it up less often.

Unfortunately I changed jobs and have forgotten most of pandas, so I'm back to looking things up again.

Re:Comprehensive Guide on Data Visualization with Pandas by disgruntledphd2 on Monday September 16, 2019 @11:22AM (#20984962)
pandas has a terrible API (IMO obviously). It looks like a weird mixture of Numpy and pre-2010 R code.

Like it has great fucntionality, but I waste so much time trying to figure out how to do something with pandas.

And I can remember the R-API's, which are even more annoying ;)

Re:Comprehensive Guide on Data Visualization with Pandas by luckydata on Monday September 16, 2019 @12:30PM (#20985771)
re: weird mixture of Numpy and pre-2010R

It does because it is.

Pandas was written by someone that was just starting out with Python at the time and was coming from programming in R.

Re:Comprehensive Guide on Data Visualization with Pandas by EForEndeavour on Monday September 16, 2019 @02:20PM (#20987021)
Pandas was extensively rewritten since its first few versions, and its GitHub repo has 1500+ contributors now, so I doubt that Wes McKinney's initial lack of python experience had much to do with the API rough spots of modern pandas. "Pre-2010 R" doesn't mean much to me, but I can confidently point out that pandas "looks like a weird mixture of numpy" because it is based heavily on numpy.
Re:Comprehensive Guide on Data Visualization with Pandas by disgruntledphd2 on Tuesday September 24, 2019 @10:03AM (#21060256)
It basically means pre-tidyverse R. pandas looks like a weird hybrid of Numpy and R. It's such a shame, as python has marvellous abstraction facilities, and yet they aren't used in pandas (__methods__ etc).
Re:Comprehensive Guide on Data Visualization with Pandas by trts on Monday September 16, 2019 @10:54AM (#20984656)
Is this actually a new feature of pandas? I've only used other libraries like seaborn and matplotlib.
Re:Comprehensive Guide on Data Visualization with Pandas by fr1tkot on Monday September 16, 2019 @10:57AM (#20984692)
It's not new, I remember using the .plot function 2 or 3 year ago. Seaborn is much better anyway though, so don't bother switching.

And the pandas plots are ugly

Re:Comprehensive Guide on Data Visualization with Pandas by BeetleB on Monday September 16, 2019 @11:10AM (#20984838)
IIRC, if you import seaborn, then pandas plots will use seaborn styling. I don't think seaborn is a standalone plotting library - it's merely provides styling. So you can have your cake and eat it too.
Re:Comprehensive Guide on Data Visualization with Pandas by SiempreViernes on Monday September 16, 2019 @11:17AM (#20984901)
Seaborn adds new plotting functions, not merely a new style, though I'm not sure that qualifies it to be called standalone. Certainly Seaborn has matplotlib as a dependency.
Re:Comprehensive Guide on Data Visualization with Pandas by squaresmile on Monday September 16, 2019 @11:54AM (#20985345)
You can use plt.style.use("seaborn") [0] to just use the style. Style sheets reference [1]

[0] https://matplotlib.org/tutorials/introductory/customizing.ht...

[1] https://matplotlib.org/gallery/style_sheets/style_sheets_ref...

Re:Comprehensive Guide on Data Visualization with Pandas by mayankkaizen on Monday September 16, 2019 @12:16PM (#20985599)
It is wrong to say Seaborn only provides styling. There are many types of plots available in Seaborn which are Not available in Matplotlib. It might not be extensive, but what it does, it does better than Matplotlib.
Re:Comprehensive Guide on Data Visualization with Pandas by lawlorino on Monday September 16, 2019 @10:59AM (#20984714)
This capability is at least a few years old which is when I first started using pandas. I believe it uses matplotlib on the backend for the plotting by default, and works pretty seamlessly with seaborn too.
Re:Comprehensive Guide on Data Visualization with Pandas by nerdponx on Monday September 16, 2019 @11:14AM (#20984876)
It's a matplotlib wrapper.
Re:Comprehensive Guide on Data Visualization with Pandas by BeetleB on Monday September 16, 2019 @11:09AM (#20984820)
I've been using pandas since 2012 and it had decent plotting capabilities back then.
Re:Comprehensive Guide on Data Visualization with Pandas by mjparrott on Monday September 16, 2019 @11:07AM (#20984799)
I’m not sure i would describe those graphs as “beautiful”
Re:Comprehensive Guide on Data Visualization with Pandas by min2bro on Monday September 16, 2019 @11:20AM (#20984943)
These are raw matplotlib graphs. Its crude. Not sure what's the definition of beautiful?
Re:Comprehensive Guide on Data Visualization with Pandas by erikpukinskis on Monday September 16, 2019 @11:23AM (#20984973)
Beautiful means you want to post it on Instagram.
Re:Comprehensive Guide on Data Visualization with Pandas by rcarrigan87 on Monday September 16, 2019 @10:51AM (#20984630)
Yeah, this doesn't seem to add much...was hoping for something a little deeper.