Live data from Hacker News

Python Data Visualization 2018: Why So Many Libraries?

anaconda.com

81–90 of 105 posts

Re: Python Data Visualization 2018: Why So Many Libraries?

#81
I would strongly recommend against anyone using Seaborn.

I used it for charts in a paper recently, since it includes swarm plots. I hit a problem when overlaying certain types of plot on the same axes (I think it was swarm plots on top of box plots, so I could show every data point as well as the quartiles). The problem was that the data would end up shifted, so the x axis labels weren't correct, even though each plot on its own would work fine when the other was commented-out. The only reason I noticed this was because I spotted that a peak I knew occurred at x=13 was showing up at x=14.

Although it took a specific set of circumstances to trigger, I thought this was still a serious problem since it causes data to be misrepresented, and it doesn't cause any warning, etc. that something is wrong. I made a minimal example script, opened a github issue ( https://github.com/mwaskom/seaborn/issues/1409 ), where the library author insulted me and locked the issue. I sent them a followup email, to explain that I was not after "free tech support" (I'd already worked around the issue for my paper by 'faking' the labels), I wanted to help improve the library so that others would avoid having incorrect plots (especially those not lucky enough to spot it like I was) and how I'd already spent considerable time narrowing down the problem to the minimal example, as evidence that I wasn't trying to be a freeloader. I also began my email with an apology for using this side channel, and that I wouldn't contact them again unless they consented to it. The author replied with more insults.

I didn't contact them again, as promised, but now I'm actively opposed to anyone using this project, due to the author's complete disregard for corruption of scientific data.

Re: Python Data Visualization 2018: Why So Many Libraries?

#82
post #77
post #66

Earlier quoted context omitted.

Personally, I don't _want_ a grammar of graphics; I want a grammar of data, where the data happens to have a graphical representation. I don't want to spend ages piecing together a fancy plot; I want to spend just a little time annotating my data to declare what it means, and then no matter how I slice and dice my data it will show up in a meaningful way. That way I can explore it to really understand it, which is th…

I don't _want_ a grammar of graphics; I want a grammar of data, where the data happens to have a graphical representation The point of having a graphical representation is to communicate with other humans therefore some subjective judgement is required; there’s no “one true plot” for each type of data.

Of course! HoloViews does allow infinite customizability, to pull out more and more subtle features, show things more clearly, and just to make it look nice or to match your favorite style. But unlike ggplot2, HoloViews does that in a way that can apply to the _data_, rather than having to recapitulate the process every single time you build an individual plot. That way you and your colleagues can together build up whatever style you find most effective, then keep working with it across the full multidimensional landscape of data that you work with in a particular field. HoloViews is a completely different approach, if you really let the ideas sink in (e.g. from our paper about it at http://conference.scipy.org/proceedings/scipy2015/pdfs/jean-...), and is in no way a second-class citizen compared to ggplot2 or any other approach in R...

Re: Python Data Visualization 2018: Why So Many Libraries?

#83
post #82
post #77

Earlier quoted context omitted.

I don't _want_ a grammar of graphics; I want a grammar of data, where the data happens to have a graphical representation The point of having a graphical representation is to communicate with other humans therefore some subjective judgement is required; there’s no “one true plot” for each type of data.

Of course! HoloViews does allow infinite customizability, to pull out more and more subtle features, show things more clearly, and just to make it look nice or to match your favorite style. But unlike ggplot2, HoloViews does that in a way that can apply to the _data_, rather than having to recapitulate the process every single time you build an individual plot. That way you and your colleagues can together build up w…

I’ll check it out, thanks for the tip!

Re: Python Data Visualization 2018: Why So Many Libraries?

#84
I teach Python for Data Analysis and struggle in recommending good visualization solutions in Python.

Most of my students are used to Excel and are new to programming.

Expensive proprietary packages like Tableau(and even Power BI) provide a much better experience when it comes to presenting your results to management.

So we do the data gathering/wrangling/munching/analysis in Python but export the results for commercial visualization packages.

I can't in good conscience recommend any one Python library for visualization.

I mean for people who are just getting a hang of Python not Wes McKinney :)

Re: Python Data Visualization 2018: Why So Many Libraries?

#85
Python is an easy to use powerful development language. Ironically, this leads to too many projects solving the same problems. It isn’t just visualization that has so many libraries, it’s almost everything.

I first noticed this effect with Python web-frameworks years ago. There was always some new framework that worked better or differently for some use case. (There are 73 web-frameworks listed in the python.org wiki.)

A few more examples from pypi.org searches:

“Reed-Solomon” 84 packages

“Elliptic-curve” 535 packages

“Nearest neighbor” 408 packages

“Simplex” (as in simplex method) 29

“Django” 10,000+

I just noticed a HN post about a RAFT implementation in Haskell. Pypi.org says there are 22 hits for RAFT in the python package index.

Re: Python Data Visualization 2018: Why So Many Libraries?

#86

Remember the old joke, "Python is the only language that has more web frameworks than keywords."? What eventually happened was that the BDFL blessed Django and most of the others withered. Some had enough ecosystem, or were components of some other larger project, or had a niche advantage of Django, and they managed to survive. I think the reason why web frameworks and data viz systems proliferate in Python is just t…

5+ years and 321 contributors later, I can state that Bokeh was not easy to write. Fairly sure MPL and Plotly devs would disagree with this assessment as well. Python has a multitude of vis systems because there are multiple use-cases, sometimes overlapping and sometimes not, and different people prioritize these very differently (and that's OK).

Sorry! I didn't mean to disparage your efforts, or anyone's.

I should have said maybe, "relatively easy in Python".

Re: Python Data Visualization 2018: Why So Many Libraries?

#87
post #71

Earlier quoted context omitted.

> What more could one ask for?? A refactoring and merging of these libraries to enable fewer people to maintain more functionality, such that the bus-factor of any given part of the functionality is higher.

That's entirely backwards, to reduce the bus factor, you need more people maintaining less, not fewer people maintaining more. In any case, the incentives are simply not there, as different projects have very different priorities (which is why there are so many projects). Some folks want to monetize their special sauce (Plotly). Some folks want to focus on high level statistical charting (Altair, Chartify) Some folks…

> you need more people maintaining less, not fewer people maintaining more

I see how you got confused, but I was making two separate assertions.

Assertion 1: If you merge the library projects together, and strip out the redundancies between them, then you'll have the same number of contributors, now distributed over fewer total lines of code. So each contributor can learn more of the codebase. (Bus factor goes up.)

Assertion 2: If you refactor the resulting libraries to reduce the total complexity (i.e. reduce the API surface from that of the union of all the merged-in libs), then you can begin to strip out technical debt from the project from the outside in. By eliminating now-dead code, you remove places where bugs can arise, and you lower the number of dependencies (which could otherwise have been sources of API-breaking changes when they update.) Thus, the number of people needed to maintain the project goes down. So the same total functionality can then be maintained by fewer contributors. (You don't actually remove contributors; they just become reserve capacity, with each contributor able to be less-overworked for the same result.)

Re: Python Data Visualization 2018: Why So Many Libraries?

#88
post #67

Earlier quoted context omitted.

Pandas dataframes can autocomplete column names using the dot syntax.

I know I can auto complete with df.mycolumn But what about df.sort_values(by='mycolumn') In that kind of cases RStudios is smart enough to know that such an argument should be populated by a column name from the dataframe that function is being applied to.

Can't you use df.mycolumn in that position, and get the completion?

Re: Python Data Visualization 2018: Why So Many Libraries?

#89
post #87

Earlier quoted context omitted.

That's entirely backwards, to reduce the bus factor, you need more people maintaining less, not fewer people maintaining more. In any case, the incentives are simply not there, as different projects have very different priorities (which is why there are so many projects). Some folks want to monetize their special sauce (Plotly). Some folks want to focus on high level statistical charting (Altair, Chartify) Some folks…

> you need more people maintaining less, not fewer people maintaining more I see how you got confused, but I was making two separate assertions. Assertion 1: If you merge the library projects together, and strip out the redundancies between them, then you'll have the same number of contributors , now distributed over fewer total lines of code. So each contributor can learn more of the codebase. (Bus factor goes up.)…

> If you merge the library projects together

Alas, it's not so simple. How much actual overlap is there to merge in Bokeh and Matplotlib, for instance? MPL renders images in Python and has no JS component. Bokeh does all of its rendering in JavaScript! The Python API is mostly just a thin wrapper around BokehJS. MPL has no server component at all. Neither of the does what Datashader does for large data sets. Neither of them has a high level statistical charting API, that's only in Seaborn or Chartify. Merging all these things together would cost a fortune in time and money, and at the end of the day not actually reduce the total codesize to any appreciable degree.

Re: Python Data Visualization 2018: Why So Many Libraries?

#90

I would strongly recommend against anyone using Seaborn. I used it for charts in a paper recently, since it includes swarm plots. I hit a problem when overlaying certain types of plot on the same axes (I think it was swarm plots on top of box plots, so I could show every data point as well as the quartiles). The problem was that the data would end up shifted, so the x axis labels weren't correct, even though each plo…

Agreed! Why would anyone risk using Seaborn after seeing the way that library author treated potential contributors pointing out a valid bug.
Post reply on HN