Latest / Talk Python To Me / #269: HoloViz - a suite of tools for Python visualization
Transcript
- 0:00The toolchain for modern data science can be intimidating.
- 0:02How do you choose between all the data visualization libraries out there?
- 0:06How about creating interactive web apps from those analysis?
- 0:09On this episode, we dive into a project that attempts to bring that whole story together,
- 0:14HoloViz.
- 0:15HoloViz is a coordinated effort to make browser-based data visualization in Python easier to use,
- 0:20easier to learn, and more powerful.
- 0:22We have Philip Rudiger from HoloViz here to guide us through it.
- 0:25This is Talk Python To Me, episode 269, recorded June 15, 2020.
- 0:30Welcome to Talk Python To Me, a weekly podcast on Python, the language, the libraries, the
- 0:48ecosystem, and the personalities.
- 0:50This is your host, Michael Kennedy.
- 0:52Follow me on Twitter, where I'm @mkennedy.
- 0:54Keep up with the show and listen to past episodes at talkpython.fm, and follow the show on Twitter
- 0:59via at Talk Python.
- 1:00This episode is sponsored by Brilliant.org and Datadog.
- 1:04Please check out what they're offering during their segments.
- 1:06It really helps support the show.
- 1:07Philip, welcome to Talk Python To Me.
- 1:10Thanks so much for having me.
- 1:11I'm excited to have you here.
- 1:12Now, we're going to talk about a bunch of cool libraries that are all brought together
- 1:16around this HoloViz overall meta project, if you will, to kind of make...
- 1:22Yeah, exactly.
- 1:22This umbrella to make working with data and exploring and visualizing it in Python a little
- 1:27bit easier.
- 1:27And I think that's a great project, and it looks like it's getting a lot of traction, and I'm
- 1:32happy to be here to chat about it.
- 1:33I'm excited to talk about the various libraries in it.
- 1:36Yeah, absolutely.
- 1:37Before we get to that, though, let's start with your story.
- 1:40How did you get into programming in Python?
- 1:41So I got started with programming pretty late.
- 1:44So apart from the usual thing of the 90s, you had a GeoCities website, you hacked some HTML,
- 1:50CSS.
- 1:50I really didn't get started with actual programming until I joined an electronic engineering course
- 1:55in my undergrad.
- 1:56So I moved from Germany to the UK to study electronic engineering and music technology, thinking I
- 2:04was better at music than I really was.
- 2:06But I took a liking to kind of programming.
- 2:07We did some programming in C and Barilog, the pretty low-level stuff.
- 2:11And then towards the end of that project, kind of that undergrad degree, I developed a simulator
- 2:17of like bipedal locomotion in C++, which was far more complex than I'd envisioned it.
- 2:23But it was really exciting to me to kind of actually get into like a big project of my own.
- 2:28And from there, I then joined a master's course and started programming in Python and doing
- 2:33data analysis.
- 2:34And we had this simulator called Topographica, which did kind of...
- 2:37That's cool.
- 2:38You talked about working on this bipedal locomotion simulator in C++.
- 2:42Like, forget the language.
- 2:43That kind of stuff is trickier than it seems like it should be, right?
- 2:47Oh, absolutely.
- 2:48Because back then I had no idea about neural networks.
- 2:50It was like I just kind of jumped in, heard about neural networks, heard about like genetic
- 2:54programming.
- 2:54So I built a huge network with way too many parameters and assumed like generic programming
- 2:59would make it work.
- 3:00It didn't.
- 3:01It didn't really work.
- 3:02The simulator worked.
- 3:02So it did flop around and like my little bipedal humanoid would flop around a little bit, but
- 3:08it never actually managed to generate actually real bipedal motion.
- 3:12Yeah.
- 3:12I guess there is something to training these models correctly and getting them set up right
- 3:17in the first place.
- 3:18It's not just magic that you can throw at a problem, right?
- 3:21Yes.
- 3:22But then I decided this thing wasn't complicated enough, so I'd actually try and solve the brain.
- 3:26So that's, I then joined a master's and PhD graduate program, neural informatics.
- 3:32And yeah, hoping to actually learn about how these things actually work.
- 3:36Oh, that's really cool.
- 3:36So was that like trying to model the way brains and synapses work using neural networks?
- 3:42Yes.
- 3:42So it was pretty close to what you'd consider like a convolutional neural network nowadays.
- 3:47Well, they were around back then.
- 3:48They weren't as popular.
- 3:49Yeah.
- 3:50And then, but then we also have like recurrent connections and it was, the idea was to model
- 3:53the human visual system, basically.
- 3:55You're just generally the mammalian visual system.
- 3:57And so starting to vary a little bit.
- 3:59What kind of problems were you trying to do?
- 4:01What were you trying to ask it to do and see if it, what was success for you?
- 4:05It was really, the idea was that it was self-organizing, right?
- 4:08So that you didn't have to reprogram a bunch of like known stuff into the network or just
- 4:13kind of organize like many of the convolutional neural networks nowadays do.
- 4:18But we were trying to kind of keep it closer to the actual biology.
- 4:22So we had different cell types that were interacting and those models were tremendously complex and
- 4:28it was just super hard to analyze them.
- 4:29Like I started having these huge model outputs.
- 4:32Like I have like 60, 100 page outputs of like a model run of PDFs with just images in it.
- 4:38And that's actually where I started developing these visualization tools.
- 4:41So me and a colleague of mine were like, yeah, this isn't feasible.
- 4:44We can't analyze these things properly.
- 4:47Just looking, like flipping through PDFs, I'd wake up and like flip through these PDFs
- 4:51and almost cut myself.
- 4:52And then I'd start, we started writing this.
- 4:54Yeah.
- 4:55It's like trying to watch the green in the matrix, right?
- 4:57Like just trying like, no, I can't see it this way.
- 4:59This is, we got to look at it better.
- 5:00Yes, precisely.
- 5:01So the idea was that we'd start building something like you have these huge parameter spaces,
- 5:06right?
- 5:06It's like excitatory strings, inhibitory strings, the model would evolve over time.
- 5:10And so we had these very complex parameter spaces that we were trying to explore.
- 5:15And so we built this tool called HoloViews to kind of start digging into that and kind of
- 5:20visualizing like what effect does this parameter actually have on the evolution of the model?
- 5:24So you could drag a slider and see the accessory strength of this to the model, the inhibitory
- 5:28strength of that.
- 5:29And so then this is how it evolves over time.
- 5:31And that was really breakthrough to actually start analyzing.
- 5:34But it also meant that I eventually started spending more time building this visualization
- 5:39tool than I was actually spending on my actual project.
- 5:43And I found that's one of the challenges.
- 5:44I found that in the end, I found that more rewarding than actually working on.
- 5:48Yeah.
- 5:48That's the real danger, right?
- 5:49Is like, I mean, I started getting into programming, doing research on complex dynamical systems and
- 5:55math and whatnot.
- 5:57And I, after a while, I realized, you know, the part of this project that really makes me
- 6:02happy is when I'm not doing the math.
- 6:04That was a sign that I should probably be doing something else.
- 6:07But it's, it is really fun to build these things.
- 6:10I also do think it's, you know, it's a challenge of research projects and this academic stuff in
- 6:16general is it's hard to get credit for that, right?
- 6:20Like you're not, they're not going to go, man, that's a killer contribution to data science
- 6:25that you made.
- 6:25Here's your PhD.
- 6:26They're like, where's the network?
- 6:28Where's the paper, right?
- 6:29Right.
- 6:29Where's the publication?
- 6:30Yeah, exactly.
- 6:31Where's the publication?
- 6:32Exactly.
- 6:32Yeah.
- 6:33And actually we did publish a paper on all of these and that was turned out to be the
- 6:38only paper I published in my PhD.
- 6:39The rest, I mean, yeah, basically my models didn't work until the very end, like two weeks
- 6:45before I handed in my thesis, the models started working and I actually had results, but I never
- 6:50got around to actually publishing.
- 6:51Man, that's down to the wire.
- 6:52Yeah, it was really down to the wire.
- 6:54And at least, yeah, I'm kind of glad that's over with.
- 6:57Yeah.
- 6:58Well, it's, it's better late than never in that case.
- 7:00So that's how you got into programming and found your way over to Python.
- 7:04I mean, obviously it's a natural place to go.
- 7:07Python is if you're doing neural networks.
- 7:09What time frame was this in?
- 7:12Like what year was this?
- 7:13So I joined this.
- 7:15It was a really good program.
- 7:16So it was the doctoral training center in Edinburgh that actually doesn't exist anymore.
- 7:20So it was part of the informatics department, but they had close collaboration with the neurotrans
- 7:26department.
- 7:27And I joined in 2010 and the first year was a master's program.
- 7:30And then it was kind of, it took me way longer than it should to finish my program.
- 7:36But I think in 2015, I handed in the thesis and did my defense.
- 7:42Yeah.
- 7:43Yeah.
- 7:43Cool.
- 7:43I'm just wondering, you know, you started in 2010 with, with some of this stuff.
- 7:48If you started now, how much easier do you think it would be, or would it be basically the same to work on?
- 7:53The visualization problems, the neural network problems?
- 7:56It just seems like that has come so far in the last five years.
- 7:59Oh, absolutely.
- 8:00So back then I remember like we had, obviously we had to interface with C code a lot.
- 8:05And so we had to, we used something called SciPy Weave, which many people probably don't know about anymore.
- 8:11Yeah.
- 8:11But it was this really awkward interface for C extensions.
- 8:14And nowadays that would be, I mean, you've got things like Numbo, you could write the kernels that were running these neural networks.
- 8:20And like in pure Python, you know, just to compile it to something fairly optimized.
- 8:24Right.
- 8:25Absolutely.
- 8:25Same with the visualization tools.
- 8:26There's like so many interactive visualization tools at this point.
- 8:29So back then, for example, all of you just built using, on top of MepaLoop, that's what it output.
- 8:34But the actual rendering nowadays, we build on bouquet and property.
- 8:40And so we've gotten a lot more insights just contractively exploring this data.
- 8:44That's really cool.
- 8:45It's been such a huge evolution of tools.
- 8:47Yeah.
- 8:47Nice.
- 8:48All right.
- 8:48Well, what are you up to these days?
- 8:50What do you do day to day?
- 8:51So it's really nice.
- 8:52I have kind of the freedom to switch between, well, not total freedom, but we kind of, when
- 8:57I joined Continuum Analytics, which is now Anaconda in 2015, actually, before I handed in my thesis,
- 9:03I was running out of funding and then joined Anaconda kind of as a day job between writing
- 9:08my thesis.
- 9:09All right.
- 9:09And so I joined to do consulting.
- 9:11Basically, I'd solve machine learning and visualization problems for various government
- 9:16clients, corporations, and so on.
- 9:18But from the very beginning, we kind of had this idea of we'd build open source tools that
- 9:23would solve people's problems and then use them in our consulting.
- 9:27That kind of model worked really well for us.
- 9:29The entire whole of this suite of tools was built kind of as a spending quite a bit of
- 9:35open source time, unpaid or unbillable time on the open source side.
- 9:39But also, kind of, for example, a panel was built with funding from U.S. Army Corps of Engineers.
- 9:45So they just started to take a gamble with us and built this new dashboarding framework.
- 9:49And so I had the freedom for over basically six, nine months to build this new tool.
- 9:54Yeah, a panel is really cool.
- 9:55We'll talk about that for sure.
- 9:56So yeah, I go between most of my time is consulting work.
- 10:00But as much as possible, we try to contribute the stuff we work on during that time back to
- 10:05the open source.
- 10:05Yeah.
- 10:06And so you mostly do remote work, I would guess?
- 10:08Yes.
- 10:09So actually, I was in Edinburgh.
- 10:11Anaconda in Austin?
- 10:13Yeah, I was in Edinburgh for years.
- 10:15And then last year, I moved here back to Berlin, which is where I grew up.
- 10:17And actually, we had an office.
- 10:19So Anaconda just opened an office here.
- 10:21And I thought it would be nice to actually spend two to three days a week just actually
- 10:25going to the office, seeing people have a more regular routine.
- 10:29Yeah, yeah.
- 10:30Just work until 3 a.m.
- 10:31And then getting up before noon.
- 10:34And then COVID happened and we're back to being fully remote.
- 10:37Yeah, yeah.
- 10:38Well, going to be around people.
- 10:40Yeah, not everyone's used to it.
- 10:41Yeah, for sure.
- 10:43It's a bit of a bummer.
- 10:44I mean, for folks like us who can work remotely and just carry on mostly doing what we're doing,
- 10:50it's a bit of a bummer.
- 10:50For a lot of people, it's a tragedy, right?
- 10:52It's a huge, huge problem.
- 10:53Especially for kids.
- 10:56I don't know how people do it.
- 10:58I know.
- 10:59It seems really, really scary.
- 11:02Hopefully we get through that soon and we can go back to an office.
- 11:05Who knows what people's desire to get back to work together will be like.
- 11:09Some of these remote ideas, I think, are going to stick.
- 11:12And some people are kind of like, oh, so glad that's over.
- 11:14Yeah, I think so.
- 11:15Particularly, I mean, it's really not a good test for people talking like this is going
- 11:18to usher in the revolution.
- 11:19But it's a forced scenario, right?
- 11:22People don't have childcare.
- 11:24They're stuck at home.
- 11:25Yeah.
- 11:25So I don't know if it'll just put people off of remote work entirely.
- 11:31Well, I think you touched on the real challenge.
- 11:34It's one thing to say, well, let's all try to be remote for a while.
- 11:37It's another to say, let's work with your small children around you all the time.
- 11:41Like, that is the real struggle, I think, as a parent to find the time and the focus, right?
- 11:48So I think it's an unfair test.
- 11:49But if it's working under these scenarios, this is like the worst case scenario.
- 11:53So obviously...
- 11:54And it still seems to be mostly working, right?
- 11:55Exactly.
- 11:57Exactly.
- 11:57It's interesting.
- 11:58Also, it's kind of nice.
- 11:59I actually kind of like, I don't know, you have a client meeting and get all stolen.
- 12:02Yeah.
- 12:05Yeah.
- 12:05It does humanize people a little bit.
- 12:07I think, you know, it's...
- 12:09I don't want to go too far in it, but like, you know, watch the news or you watch like comedy
- 12:13shows that are still going.
- 12:15And it's just like, yeah, everyone's at their couch or at their kitchen table or just their
- 12:20little home office.
- 12:20And yeah, it's funny.
- 12:22So let's talk about the history of this project a little bit.
- 12:27So you started with HoloViz.
- 12:29HoloViz.
- 12:30HoloViz.
- 12:32Yes.
- 12:32Thank you.
- 12:32So Holo...
- 12:33Yeah, it's kind of confusing.
- 12:34And there's...
- 12:35Yeah, yeah.
- 12:36I know.
- 12:36There's even more confusing history around it, which I'm sure we'll get into.
- 12:41This portion of Talk Python To Me is brought to you by Brilliant.org.
- 12:44Brilliant has digestible courses in topics from the basics of scientific thinking all the way
- 12:49up to high-end science like quantum computing.
- 12:52And while quantum computing may sound complicated, Brilliant makes complex learning uncomplicated
- 12:57and fun.
- 12:58It's super easy to get started, and they've got so many science and math courses to choose
- 13:01from.
- 13:02I recently used Brilliant to get into rocket science for an upcoming episode, and it was a
- 13:06blast.
- 13:07The interactive courses are presented in a clean and accessible way, and you could go
- 13:11from knowing nothing about a topic to having a deep understanding.
- 13:14Put your spare time to good use and hugely improve your critical thinking skills.
- 13:19Go to talkpython.fm/brilliant and sign up for free.
- 13:22The first 200 people that use that link get 20% off the premium subscription.
- 13:27That's talkpython.fm/brilliant.
- 13:30Or just click the link in the show notes.
- 13:34How did you go from trying to create better visualizations to this larger project?
- 13:39I guess, as a way of introduction, maybe tell people how you got there, and then give us
- 13:44a high-level view of what it is.
- 13:46Yeah, absolutely.
- 13:47So we started with Olive Views, which was actually built on this project called Param.
- 13:52So Param is kind of like, we now have data classes in Python, kind of parameters on classes,
- 13:59that are typed and so on, and there's projects like Patelits.
- 14:03So Param was kind of the foundation of everything.
- 14:05Built on top of that to kind of have type validation, just general semantic validation as well.
- 14:12This thing is not just a tuple, but it's a range of two numbers.
- 14:16It actually represents a range.
- 14:18That was kind of the initial thing, which had been around before I even got into Python.
- 14:23And then we built Olive Views on top of that.
- 14:25And then one of our first projects at Continuum, back in the Continuum days, was for the UK
- 14:32med office to build, kind of extend Olive Views to have geographic support, brought about
- 14:38GeoViews, which is kind of just an extension for Olive Views.
- 14:40And then...
- 14:41Right.
- 14:41Obviously focused on, you know, geographical data and map data and whatnot.
- 14:45Yes.
- 14:46Yeah.
- 14:46Handling the projections for you and stuff like that.
- 14:48That's just quite nice.
- 14:50But then, I mean, what we saw over and over again as part of our consulting project was
- 14:54people were happy to have these analysis and a lot of them were in notebooks.
- 14:58And then people would share these notebooks.
- 15:00But really, someone who doesn't know about code is kind of scared or put off by all the
- 15:06code in this notebook.
- 15:07And they want another way to share it.
- 15:09And that's kind of how we started building dashboarding tools.
- 15:12Right.
- 15:12So notebooks are pretty nice to show people.
- 15:15But at least in Jupyter, as far as I know, there's not a great way to say, please load
- 15:19this with every bit of code collapsed.
- 15:21Right.
- 15:22So, I mean, there's templates, but maybe they're kind of obscure.
- 15:24Not everyone is familiar with them.
- 15:26And just generally, like, if you just want to have everything nicely presented as a nice
- 15:31layout that you put together.
- 15:32There wasn't really tools for that.
- 15:34Yeah.
- 15:35Right.
- 15:35Right.
- 15:35Okay.
- 15:36But all of that has changed.
- 15:37I'll get into that a little bit.
- 15:39And then we just needed a name for all of this stuff, which we decided on Pyviz.
- 15:44Pyviz seemed like a good name.
- 15:45It wasn't taken.
- 15:45And then it was a great name.
- 15:48But we had a little bit of pushback from the community.
- 15:50Pyviz sounds like just Python visualization, right?
- 15:53It's kind of presumptuous to think that it's a name we could keep.
- 15:57Like, you can't claim it all.
- 15:59Right.
- 16:00And I think that was...
- 16:01We've got Bogey.
- 16:02We've got, yeah.
- 16:03Yeah.
- 16:03It was a totally fair criticism.
- 16:05And we kind of talked to various community members and were like, okay, Pyviz becomes this
- 16:09general thing and we're going to find a new name, which has been confusing.
- 16:12Like, obviously, we haven't...
- 16:14I think this was a year and a half ago.
- 16:16And we kind of run with the Pyviz name for a year and a half as well.
- 16:19And so oftentimes when you see a blog post out there now, it's still the Pyviz is us,
- 16:25not the general resource that it's meant to be.
- 16:27Yeah.
- 16:28I was looking at some videos on YouTube about some of the presentations you gave and stuff.
- 16:32And I saw sometimes it was called HoloViz and sometimes it was Pyviz.
- 16:35And I'm like, oh, I wonder what the relationship is here.
- 16:37And I see historically where that comes from.
- 16:39Yeah.
- 16:39Yeah.
- 16:39So I think overall, it was a good idea to kind of have Pyviz.org become this general resource.
- 16:44And we absolutely, we're happy to kind of have this listing of all the different visualization
- 16:49dashboarding libraries on there.
- 16:50And we'd like to have more tutorial material to point to and stuff like that.
- 16:54So just it becomes a general resource.
- 16:56And HoloViz is now our effort to kind of have a coordinate and we need a set of tools that
- 17:01work well together to have browser-based visualization, dashboarding, and just make that easier and make
- 17:07it all fit together.
- 17:08Yeah.
- 17:08Very cool.
- 17:09You're basically making a bunch of choices for people.
- 17:12Like, here's a way that you can plot stuff.
- 17:14Here's a way that you can stream data or process large amounts of data with what doesn't fit in
- 17:19RAM or whatever.
- 17:19Yeah.
- 17:20But you're not forcing them down that path, right?
- 17:22One of the things that was cool is like, okay, if you need more control or you want to do
- 17:26something different, you can just do this yourself.
- 17:27If you want to not do less work and accept the defaults or the default way of working, right,
- 17:32you can use something built in.
- 17:34That's exactly right.
- 17:35Yeah.
- 17:35So the idea that there is, the way we try to communicate that is it's about shortcuts,
- 17:40not good ends, right?
- 17:40To make it easy, the default should be good.
- 17:42You should just be able to get something on screen quickly, which is kind of a philosophy
- 17:46that you could use in particular.
- 17:48You just wrap your data and it visualizes itself.
- 17:51But then you shouldn't be stuck there.
- 17:53It shouldn't be.
- 17:53There's plenty of libraries where you just put, get your quick plot, but then it's really
- 17:57hard to customize from there.
- 17:58And that's something we had to learn as well, I think.
- 18:01So all of these is pretty opinionated, actually.
- 18:03And it doesn't fit the regular model that people are thinking of, right?
- 18:07It's imperative plotting model where you say, you get your figure, get your axes, you kind
- 18:12of modify each little bit of the axes.
- 18:13It's about just wrapping your data and have it visualize itself.
- 18:16And then you can tweak the options on it.
- 18:19And that model doesn't work for everyone, which is something we had to learn.
- 18:23We've kind of decided now that we'd rather meet people where they are, right?
- 18:26People already, there's already such a big ecosystem of visualization tools.
- 18:31And at this point, even a big ecosystem of dashboarding tools.
- 18:35And rather than tell people, like, this is the way you have to do it, you should just be
- 18:39able to plug in what you have and go from there.
- 18:42And that's the Ada philosophy behind HV plot, which is kind of a wrapper around all of you,
- 18:47which just, you use Pandas, you'll know that Pandas has a .plot API, which just takes your
- 18:54Pandas data and you tell it a little bit of, like, this goes on the x-axis, this goes on
- 18:58the y-axis.
- 18:58I want to color by this variable.
- 19:01And then it gives you the plot.
- 19:02And we wanted to take that and kind of say, well, this works well for Pandas.
- 19:05We want it to work for the entire pay data.
- 19:08Right.
- 19:08HV plot is meant to work not just with Pandas, but with Dask, X-Ray, NetworkX, Geopandas.
- 19:14And the most recent addition there is QDFs.
- 19:17So GPU data.
- 19:19Yeah.
- 19:19I haven't heard of QDF.
- 19:20That sounds really cool.
- 19:21But, like, Dask is very powerful.
- 19:23And I had Matthew Rockland on the show to talk about that.
- 19:26And it's like data.
- 19:28That's what's important.
- 19:29It's like Pandas.
- 19:29Yeah.
- 19:30It's like Pandas, but across multiple machines if necessary.
- 19:33Sort of thing that has the same.
- 19:36If necessary.
- 19:36Or across multiple cores locally.
- 19:38Yeah.
- 19:38Lots of you.
- 19:40Yeah.
- 19:40Scaling up and out.
- 19:41Yeah.
- 19:41It's super cool.
- 19:42And that's super nice, particularly because we have this data shader project.
- 19:45It basically takes your data and you can describe it as like a fancy 2D histogram, right?
- 19:50You get some basically heat map out.
- 19:53But it does this really fast.
- 19:54It's built on Numba and Dask.
- 19:56So you can generate basically images from data points really quickly.
- 20:02It doesn't just support point data.
- 20:04It supports polygons.
- 20:05It supports lines.
- 20:05It supports re-grading of rasters and quad meshes and tri-meshes.
- 20:09And basically it just takes your data, renders it with Numba and Dask.
- 20:12Just put something on screen really, really quickly.
- 20:15And the idea there is just to have fast and accurate rendering of large data sets.
- 20:20And when we're talking large, that means millions or billions of dollars.
- 20:23Yeah.
- 20:23That's cool.
- 20:24I think it was on your project where you've got a picture of, was it the US?
- 20:28Yes.
- 20:29Plotting every single person and where they were.
- 20:31Right.
- 20:31300 million data points.
- 20:32Super quickly?
- 20:33Yeah.
- 20:33Yeah.
- 20:34300 million data points a second or less.
- 20:36And interactively zoom in and out.
- 20:38I think particularly now that we have the app support, which basically NVIDIA has this new
- 20:43initiative called Rapids, where they're rebuilding the PyData ecosystem on top of GPUs.
- 20:50That's crazy.
- 20:51It is crazy, but you couldn't always use.
- 20:53Crazy awesome, yeah.
- 20:53Yeah.
- 20:54Like, yeah, exactly.
- 20:55You used to have to write these CUDA kernels yourself, and it was really obscure.
- 20:59But now it's, you just use your GPU and it just works.
- 21:03So they had initial prototype for Data Shader, and our collaborator of ours called John Meese,
- 21:10who normally is chief scientist at Botley, and took that and extended Data Shader to support
- 21:17GPUs natively.
- 21:17So now you can, like, it takes maybe 10, 20 milliseconds to aggregate these 300 million
- 21:23data points.
- 21:23Wow.
- 21:24It's just incredible.
- 21:25So cool.
- 21:25And in theory, it's also scaled across multiple GPUs.
- 21:28I haven't been able to try that.
- 21:30Yeah.
- 21:30I don't have access to that.
- 21:31It never ceases to amazes me how powerful GPUs are.
- 21:35Right.
- 21:36Yes.
- 21:36Every time I think, wow, it can do that, that's amazing.
- 21:39And then it's like, nope, it could do more.
- 21:41Exactly.
- 21:42And yeah, it's kind of, for us, it's coming full circle, right?
- 21:47GPUs, G and GPUs stands for graphical.
- 21:49Yeah.
- 21:50If you actually wanted to use it for graphical stuff or visualization stuff, there is basically,
- 21:54well, you have to write your own kernels.
- 21:56It would be super painful, but now it's possible.
- 22:00All the hard work that you reference for actual people.
- 22:02That's super cool.
- 22:03Very, very cool.
- 22:04All right.
- 22:04So we've got hollow views and then related to that, the library, geo views.
- 22:09You talked about HV plot.
- 22:11Yes.
- 22:11Talked about data shader.
- 22:12This is what we were just talking about, quickly rendering like 200 million points on a map.
- 22:16Talked about param as the basis for like the data class like functionality.
- 22:20We also have color set.
- 22:22Yes.
- 22:22Color set is just, we all know that color maps can be crucial.
- 22:27I don't know if everyone knows this, but I think the most famous example is the jets or rainbow color map.
- 22:32That's been so divided for a good reason.
- 22:35Basically, it distorts the data space terribly and you can draw all kinds of false conclusions just because in color space it can really distort things.
- 22:44So there's actually scary stuff about potentially like doctors may have drawn false conclusions just by looking at the color maps.
- 22:51That's jets in risk interpreting jets, which is easy to do.
- 22:55So we created this package called color sets, which basically just has a set of, it's actually uniform color maps.
- 23:02It actually takes work, I should have read up on this, but basically we took a set of color maps that someone had published a paper about and kind of published, draft those for the Python ecosystem.
- 23:12And that became color set.
- 23:13So please look at the website to look up the names.
- 23:16I feel bad for not properly crediting the person here.
- 23:19It's really handy to have that put together and well thought through and yeah.
- 23:23Choosing colors, one, that look good and two, that are meaningful and not so easy.
- 23:27Yes, it's not easy.
- 23:28But I mean, thankfully the community has become really aware of this and there's a few packages like this now.
- 23:33So it's just good to see that happen.
- 23:35Particularly with like, I think the turning point was when the default column had not been not published, it's changed to very good.
- 23:41I think at one point it actually was jet, wasn't it?
- 23:43The final star of the show here is panel, which you talked about being that six to nine month project that you've got to work on new dashboarding tools.
- 23:51Yeah.
- 23:52So the Python ecosystem for a long time, R had Shiny and Shiny was great.
- 23:57It's super cool.
- 23:58It makes it easy to kind of share your analysis in R.
- 24:01And Python didn't have this, right?
- 24:02It had, there was, early on there was like this Jupyter dashboard project where you could take a Jupyter notebook and kind of arrange the cells a little bit and get a layout.
- 24:11And we used that for a little while, but then it was abandoned.
- 24:13But this was a problem that we kept coming back to.
- 24:16People wanted to share their analyses without, as an actual dashboard or just a little app.
- 24:21And so we decided to build panel.
- 24:25Just before then actually, Plotly came out with this project called Dash, which is also a really nice, nice library to build dashboards in Python.
- 24:33It requires a little bit more knowledge of CSS and JavaScript in certain cases.
- 24:37And we wanted something where people could just drop in their analysis, their existing analysis.
- 24:42You could drop it in.
- 24:43You could wrap in a function and then annotate that, like, this function depends on these things.
- 24:48And so when those things change, it updates kind of a reactive model.
- 24:52And we just wanted a library where you drop in your existing analysis.
- 24:55You've got some notebook.
- 24:56You want to share it and reduce the friction of that, right?
- 24:59That's what we kept seeing over and over again in different organizations was the fact that they had a bunch of data scientists.
- 25:04And then they had a visualization team.
- 25:06And the data scientists would produce some analysis.
- 25:08And then they have to hand it over to the visualization team.
- 25:11It didn't necessarily work in Python, right?
- 25:13It could be.
- 25:13We had some custom JavaScript framework or, yeah, there's just friction in making that transition from, let's say, Python analysis.
- 25:21To shareable dashboard.
- 25:23That process needed to become easier.
- 25:26Right.
- 25:26And that's how a panel emerged.
- 25:27So a panel is a way where, yeah, you can basically lay out different parts of visualization.
- 25:33And it's like organizing a notebook with not necessarily showing the code.
- 25:37And you get some little sliders and other widgets that you can interact with that drive it.
- 25:41And to me, it feels like just a really nice way to quickly take what you were already doing in exploratory mode and put it up in a user interactive way.
- 25:51Without learning Flask, APIs, JavaScript.
- 25:53This portion of Talk Python To Me is brought to you by Datadog.
- 25:59Are you having trouble visualizing bottlenecks and latency in your apps?
- 26:02And you're not sure where the issue is coming from or how to solve it?
- 26:05With Datadog's end-to-end monitoring platform, you can use their customizable built-in dashboard to collect metrics and visualize app performance in real time.
- 26:15Datadog automatically correlates logs and traces at the level of individual requests, allowing you to quickly troubleshoot your Python application.
- 26:22Plus, their service map automatically plots the flow of requests across your application architecture so you understand dependencies and can proactively monitor the performance of your apps.
- 26:33Be the hero that got your app back on track at your company.
- 26:36Get started today with a free trial at talkpython.fm/Datadog.
- 26:43Precisely.
- 26:43So, yeah, the idea is that, yeah, you just have your announcers, you drop them into this thing, you put it in a bunch of rails and columns, lay it out on your screen, and then you put one little command at the end of this thing.
- 26:53You build the layout you have to build called servable.
- 26:56And then you can run panels, serve the notebook, and it just pops up with your dashboard.
- 27:00Nice.
- 27:01How do you host it?
- 27:02So, actually, it's just built on Bokeh, so it's just a Tornado server.
- 27:05So you can just host it on any of the cloud server providers.
- 27:08We are trying to kind of build out our documentation to make that a really simple process.
- 27:13Or even thinking about having a command to say, I'm going to deploy this to AWS or to Google Cloud or whatever.
- 27:20Right, right.
- 27:21But, yeah, that's still areas we're actually working on.
- 27:23But in the end, it's just...
- 27:24What about like a container?
- 27:25Oh, absolutely.
- 27:26Oh, yes.
- 27:26Yeah.
- 27:27That's...
- 27:28Yeah.
- 27:28For our examples, we have...
- 27:30We build on this tool called Anaconda Project.
- 27:33It wraps a conda environment with some commands, and then it deploys it.
- 27:38And what we're hoping for is that...
- 27:41I think there's a PR, or maybe it's already merged, where you basically just give it this project file,
- 27:45which is just a YAML file with the environment and these commands that it runs.
- 27:49And then it builds a Docker container for you.
- 27:51So I think that that's a really nice route to go.
- 27:53Just to kind of contain everything, your entire environment,
- 27:56and the commands you need to run, and then you just get it.
- 27:59Yeah.
- 28:00Maybe even go to like some kind of hosted Kubernetes cluster service.
- 28:04Just go take this, run it there, make sure it keeps running, upgrade it for me if I need it.
- 28:08Yes.
- 28:09But we're certainly looking for...
- 28:10So if anyone's interested in helping us out with our friends, we're always looking for contributors.
- 28:14Yeah.
- 28:15Sure.
- 28:15But otherwise, yeah, we're also working on including documentation.
- 28:18Yeah.
- 28:19It's a bit of an orthogonal problem and skill set to solving visualization, right?
- 28:23Like, it's one thing exactly through the JavaScript.
- 28:25Cool visualization is another to like, well, now I do DevOps too.
- 28:28Exactly right, yeah.
- 28:30Although it's something, I mean, it's a good skill to learn, so I'm happy to dive into it a little bit.
- 28:34Yeah.
- 28:35Yeah, absolutely.
- 28:36So on your website, I think it's into the getting started section, so at holoviz, H-O-L-O-V-I-Z.org,
- 28:44you've got a document that sort of talks about, given these different scenarios, more of a picture, I guess,
- 28:50answer a couple of questions about it, and we'll help you choose the subset of tools to kind of flow this together, right?
- 28:58Right.
- 28:58You want to maybe talk us through some of these scenarios?
- 29:01So it says, are you working with tabular data, working with like other types of arrays, network,
- 29:06n-dimensional, or streaming data?
- 29:08And then there's like sort of this flow of like, all right, here's how you piece together these tools
- 29:13to come up with something excellent.
- 29:14Yes.
- 29:15So we call this the mermaid diagram.
- 29:16And yeah, if you look at holoviz.org, you'll find it there.
- 29:19I actually don't know why it's called the mermaid diagram, but there we go.
- 29:22But yeah, the general idea is that it takes you from the type of data, as we said.
- 29:27So let's say you've got some tabular data, and now you need to decide, like, what library should I choose to load this data?
- 29:33So you might, below a certain threshold, pandas is totally fine.
- 29:37And if you want to go to geographic data, use geopandas, or actually geometries.
- 29:42Geographic geometries, use geopandas.
- 29:44Right.
- 29:45And just so people know, yeah, and you're cut off here, you say, do you have more than 50,000 rows?
- 29:49I mean, obviously, it varies a little bit on the computer you have.
- 29:52Yeah, that's pretty arbitrary.
- 29:54Yeah, exactly.
- 29:55But it gives you a kind of a sense.
- 29:57It's not millions of rows or billions or something like that, right?
- 30:02It's not that high of a number to say, okay, well, maybe you want to consider something other than pandas for working on some of this.
- 30:08But yeah, okay.
- 30:09Is it a huge amount of data?
- 30:10By some definition, a huge.
- 30:12And if not, is it geospatial?
- 30:14Precisely.
- 30:14And then you might use geopandas.
- 30:16Otherwise, you may use Dask, for example, instead.
- 30:19So Dask is a really great tool.
- 30:21We've already mentioned time to load.
- 30:23You've got millions or billions of rows, and you just want to, you can't load it all into memory.
- 30:29You just don't have the space.
- 30:30And you want to build a Dask.
- 30:31And then the whole point behind our ecosystem, particularly HBplot, is you shouldn't have to change any code.
- 30:38Whether you choose pandas or Dask or now the QDF library, you shouldn't have to change any code.
- 30:45You should just be able to dump your data into this framework and then call .heplot on it, and then you get your plot out.
- 30:52So that's kind of the philosophy here.
- 30:54The same applies to, like, you've got some n-dimensional arrays.
- 30:58We generally recommend, for example, that you go with X-Array.
- 31:00So X-Array is really underrated as a library.
- 31:03It should be more popular.
- 31:05I don't know, maybe not that many people have, like, n-dimensional arrays, but it's kind of pandas for n-dimensional arrays.
- 31:12Yeah, for beyond tabular.
- 31:14Beyond tabular, exactly, yeah.
- 31:15So you've got, I don't know, you've got satellite imagery over time, right, or satellite.
- 31:20Right.
- 31:20Or microscope data also over time, like, or Z-Stack over time, like, four-dimensional, five-dimensional, whatever.
- 31:26Okay.
- 31:27For that, it's just really nice to explore it that way.
- 31:29So for that kind of data, you might use that instead.
- 31:32Or you might keep it simple and just use NumPy or DaskArrays, which kind of is a lower local.
- 31:37But in the end, the idea is that, yeah, in any case, you just drop it into HBplot with the .plot call, and then you get this whole of these objects out of it.
- 31:46And this whole of these objects will already display itself, so you already have an interactive plot.
- 31:50But then you might have the issue, like, yeah, this was a lot of data.
- 31:54We used a DaskDataFrame for a reason.
- 31:56Right.
- 31:57Or a DaskArray.
- 31:57So you may not want to dump it straight into your browser.
- 32:00Jumping a gigabyte to your browser is a surefire way to crash it.
- 32:03Even with the speed to download it quickly, you know, that much JavaScript is going to make it hurt.
- 32:08Yeah.
- 32:09It's really going to make it hurt, yeah.
- 32:11So that's, like, then you just have the option to HBplot to say, data shape this instead.
- 32:17And so that means that you've got server-side aggregation to kind of aggregate this data as you're zooming around.
- 32:22And what you get out is a nice interactive Bokeh plot using HBplot.
- 32:27Or if you kind of want to do a bit more customization, HBplot actually doesn't directly support Bottley or Mouthable output, but with a little bit of it, you can get there, too.
- 32:36And then once you're there, you can save it, you can share your notebook, or you can dump it into panel and do it.
- 32:42Right, right.
- 32:43Turn it into a dashboard.
- 32:44Okay.
- 32:45Yeah, very cool.
- 32:45I'll link to this flowchart for people over so they can think about it when they're checking this out.
- 32:51And I think it also gives you a sense of, even outside of HoloViz, there's useful stuff.
- 32:57You're like, do I have streaming data?
- 32:58Maybe check out StreamZ or N-Dimensional, like you said, check out X-Ray and Dask.
- 33:04And just this idea of, like, how do I think about the right underlying library rather than trying to jam everything into Pandas or NumPy or something.
- 33:11Right, yes.
- 33:11Yeah, a lot of people, I still see, like, 2D in Pandas and really, yeah, try to switch to X-Ray.
- 33:17It's a great library.
- 33:18And actually, Pandas used to have this N-Dimensional data structure called a panel, and they've actually deprecated that saying, yes, please just use X-Ray.
- 33:26That's what it's made for.
- 33:27I see.
- 33:28Okay.
- 33:28Interesting.
- 33:29I didn't realize that.
- 33:30When you talked about visualizing millions and millions of data points quickly in the browser, you said, okay, we're going to use Data Shader.
- 33:37And I don't know that we necessarily dove into it enough to say exactly what it does.
- 33:41So basically, let me see if I get it right how it works.
- 33:44It can look at millions, hundreds of millions of data points and say, well, the size of the graph is really this.
- 33:51And if you look at these 10,000 at this scale, that's kind of going to be the same.
- 33:56Is that how it works?
- 33:57Or is it, like, does it downsample somehow?
- 33:59Or how does it actually make meaningful pictures or a process of that?
- 34:04That's the cool thing about it.
- 34:05So it actually is that fast, right?
- 34:07It actually, it always looks at all your data.
- 34:09Okay.
- 34:09But if you're zoomed into something, obviously it won't.
- 34:11If it's out of your report.
- 34:13Yeah, yeah, yeah.
- 34:13If it zooms in, like, it has the clipping outside the rectangle.
- 34:16But if you're zoomed out, it actually does iterate over your entire building data points and aggregates them within 50, 100 milliseconds.
- 34:22Does that happen on the server, right?
- 34:24Exactly.
- 34:24It doesn't have the browser, right?
- 34:25Exactly.
- 34:25That happens on the server.
- 34:26And then all it has to do is send the image of the aggregated data, which, or if you have 10 million points or a billion points,
- 34:33then a thousand by thousand pixel image is going to be much, much smaller than the actual whole data set.
- 34:39Yeah, yeah.
- 34:39Absolutely.
- 34:40Yeah.
- 34:40That's basically the same size, no matter how much data you have.
- 34:45Exactly.
- 34:46Yes.
- 34:46Compression a little bit, but not so much.
- 34:48Yeah.
- 34:48Exactly.
- 34:49So, yeah, you get a fixed size image out of it.
- 34:50And that works with most visual elements.
- 34:54We've kind of been expanding to visual elements.
- 34:56When DataShare was first created, I think it aggregated point data and line data.
- 35:00But now it kind of expanded to cover polygons, tri-meshes, quad-meshes, just downsampling images as you're zooming.
- 35:07So if you've got a huge, like, one gigapixel image, you can dump it into DataShader.
- 35:12It'll downsample it dynamically.
- 35:14So you can zoom in panel rounds and export.
- 35:16Yeah, that's great.
- 35:17And looking at it, it says that it has scalability with Dask or QDF.
- 35:22Mm-hmm.
- 35:22QDF.
- 35:22How do you configure it to make it choose one or the other on the server?
- 35:26If you have a Dask data frame, it'll just take that.
- 35:29It'll take that.
- 35:29And basically, the way a Dask data frame works is basically you should think of it as a bunch of chunks of underlying Pandas data frames, right?
- 35:36And these chunks might be distributed across, like, it might be on your machine, or it might be across, like, a whole cluster of machines.
- 35:43And so it just keeps the computation local.
- 35:45It means that the aggregation for each of those chunks happens on that particular node in your cluster.
- 35:51And then once it's done the aggregation, it just has to send the fixed-size image back to the main node to aggregate that.
- 35:58And so that way, you can distribute the computation, but still have it available for virtualization.
- 36:04Okay, so what you provide to the DataShader basically tells it how to process it.
- 36:09Do you give it a Pandas data frame?
- 36:10Do you give it a Das data frame?
- 36:11Do you give it a QDF frame?
- 36:13And it just goes, and it just knows how to work with all of them, but that implies how it's computed.
- 36:18Yes, so those three in particular are, yeah.
- 36:21Got it, okay, now I see.
- 36:22So we actually, on DataShader.org, if you look at, I think, one of the user guides or sorting guides,
- 36:28there's a nice handy little table to show you, like, for this data type, like, for point data, these data backends are supported.
- 36:36And for points, for example, it might be Pandas, Dask, and Pudia.
- 36:39But for an image, it might be X-Ray only, because it doesn't really make sense to show your image into Pandas.
- 36:47Yeah, exactly.
- 36:48Cool.
- 36:49Well, it seems like a really nice way to fit all these things together, and just such a great API.
- 36:55Maybe we could talk about some of the projects or communities that are using all of this.
- 37:00Oh, absolutely.
- 37:00One ecosystem that's really taken up these goals, particularly HVPot and DataShader, is the Pangeo initiative,
- 37:08which is basically, it's an initiative by various geoscience folks to build, like, this big data platform to analyze data in the cloud, right?
- 37:17So you used to have all these different data silos where, like, you have this data in the cloud, you have to download it onto your local machine and explore it.
- 37:25And they've been building, basically, a platform so you can easily deploy your own JupyterHub and then keep your data in the cloud, but analyze it also in the cloud, right?
- 37:35And so for these people, so there might be climatologists, there's a lot of climatologists or oceanographers.
- 37:41Can I say that word?
- 37:42Oceanographers.
- 37:43Oceanographers, that's right.
- 37:44And they have these huge data sets, right?
- 37:46They have huge meshes of data, and they need to do them.
- 37:50But they weren't really cool to do that.
- 37:52And thanks to all these open-source tools like Dask, you can load the data from the cloud, aggregate it using DataShader, and kind of zoom and pan interactively around without having to kind of download the data.
- 38:03So Pangeo is a really great use of it and makes me super happy to see climatologists actually use these tools.
- 38:11Yeah, solving some real problems.
- 38:13That's awesome.
- 38:13Also, Intake.
- 38:14What's that?
- 38:15Intake.
- 38:16Oh, that's a really interesting project.
- 38:17So again, actually, this is also leveraged by the Pantheon community.
- 38:22So Intake is a project.
- 38:23If you've ever had to, like, you have a bunch of data sources, and you have data catalogs, and if you want to keep track of all your data, you want to not have custom scripts to load this kind of data and that kind of data, Intake lets you write one catalog data catalog, which is really just a YAML file to specify.
- 38:39I've got the CSV files here, and there's 10,000 of them, and I'll load them somehow.
- 38:45And then I've got this netcdf file there, and I've got a bunch of parquet files here.
- 38:49You can kind of encapsulate it all in this nice little data catalog, load it, and then I explore it.
- 38:56And so in the notebook, literally, you just point it to your catalog and say, load this, and thanks to the specification in that YAML file, it'll just load it.
- 39:04And that has integration with our tools in a number of ways.
- 39:09So first of all, you can even put your HB plot spec into your data catalog.
- 39:14So you can say, I have this default plot that I always look at for this data, right?
- 39:19So you can say, in this data source, plot the X column, point at the longitudes in this CSV file, longitudes and latitudes, and then it'll automatically generate your plot.
- 39:30You kind of pre-declared your plots in this catalog file.
- 39:34I see.
- 39:35Okay.
- 39:35Yeah, that's super cool.
- 39:36Another thing it has, it has a little GUI built on top of a panel, which kind of lets you explore the data, right?
- 39:42You've already got your data, and now you can just, by a graphical interface, kind of click around and say, I want to plot this column against this column and color it by that.
- 39:51Cool.
- 39:51So you specify how to import it and whatnot, and then visualize it.
- 39:55That's great.
- 39:55Yeah.
- 39:55And then what's QCrossFilter?
- 39:57So I only recently found out about this.
- 40:00So NVIDIA, as I said, has this Rapids initiative, and they've been playing around with visualization.
- 40:06in various forms.
- 40:07And interestingly, they built this QCrossFilter library, which kind of builds on top of panel and bokeh to build cross-filturing applications.
- 40:17Kind of, okay, just cross-filturing.
- 40:19It's also referred to as loop brushing.
- 40:21So you select something on one plot, and kind of you see that reflecting on other plots.
- 40:25And that's built on panel, and basically lets you build dashboards, like cross-filturing stuff.
- 40:32They're easily using GPU.
- 40:33Super cool.
- 40:35And then some space stuff as well.
- 40:37These are actually projects that there's consulting clients we've worked with.
- 40:41So one of them is the LSST telescope.
- 40:44I think it's recently actually got a real name, which is the Vera Rubin telescope.
- 40:47It's one of the largest optical telescope in the world.
- 40:50And they basically approached me saying they wanted to do some Q&A on the data that comes out of this telescope.
- 40:57Right?
- 40:57This telescope.
- 40:59And there's huge amounts of data.
- 41:01There's terabytes a day.
- 41:02It can be challenging because they have 50 petabytes of images and data they're going to be collecting and stuff.
- 41:09And yeah, it's challenging to go through.
- 41:11Yes.
- 41:11Particularly, yeah.
- 41:12If you have to do the same analysis every day, then you can have a tool that can handle this stuff.
- 41:17And so I handed over this project to QuantSite.
- 41:20So our famous Travis Oliphant, who is our former CEO, went off and started this other consulting firm called QuantSite.
- 41:28And I handed over this project to them.
- 41:30And they've been kind of a bit of help for me, but not very much.
- 41:33They've built this really nice dashboard to kind of do the Q&A stuff for them.
- 41:37And yeah, easily it will handle 500 petabytes.
- 41:40But maybe it'll need some more clicking to quite get there.
- 41:43Yeah.
- 41:43But still, that's pretty impressive.
- 41:45That's awesome.
- 41:45And it's cool to see all of these projects using the libraries you guys put together.
- 41:49They're probably giving it some pretty serious testing.
- 41:52Oh, absolutely.
- 41:53Testing and standard data science.
- 41:55Yeah.
- 41:55And they'll absolutely find all the little performance issues.
- 41:58And yeah, it's great.
- 42:00That's actually the best part of my job.
- 42:02I don't just building open-source tools is awesome.
- 42:04But really, if you're completely divorced from the actual users of those libraries, it's really hard to tell.
- 42:10Are you doing the right thing or are you just wasting your time?
- 42:13So it's super nice to go back and forth between actual consulting where you see people's problems and then going back to the tool and kind of improving it.
- 42:20Absolutely.
- 42:20Yeah, you need this blend to keep it real.
- 42:22But if you're too focused on just solving problems for consulting, you don't get that spare time to develop new stuff as much.
- 42:30Yeah.
- 42:31I want to close the conversation out with two quick things.
- 42:33One, I really like to explore things like this, like visual play analysis type of libraries and whatnot by just looking at some examples because usually you can look at some nice pictures and get a quick sense.
- 42:45So you guys have a bunch of different tutorials or simple little examples, expositions, showing them off.
- 42:52Maybe is there like a couple of favorites you just want to point people out and tell them what it does?
- 42:56Oh, absolutely.
- 42:56Yeah.
- 42:57I don't know how best to do this.
- 42:58So what we can do is, so most of our websites, particularly for like hollow views and geoviews and panel, we have a little gallery.
- 43:05So maybe we can look at some of those.
- 43:07But then we also have this website, examples.privates.org, which really we want contributing to the content of these articles.
- 43:14Again, privates can not be this general thing.
- 43:17So if people are interested in contributing their own examples.
- 43:19Yeah.
- 43:20Just grab a couple that you think are like really cool and show off stuff people would appreciate.
- 43:24Yeah.
- 43:24So let's go with the one that you talked about earlier, the census example.
- 43:28So if you go to examples.privates.org.
- 43:30Just search for census.
- 43:31It'll be right on the main page, right?
- 43:33There's like a little gallery.
- 43:35And then if you click on that, there's at the top right, there's the census example, which kind of explores how do I use.
- 43:41Yeah.
- 43:42I've got this census dataset.
- 43:43How do I actually display it?
- 43:45It's like start exploring it.
- 43:46So it starts off by kind of loading the dataset.
- 43:48We just load it in this case with a library called, well, and in fact, it's just loaded with Dask.
- 43:54But we've got this little wrapper around Dask, which does spatial indexing.
- 43:57So spatial indexing means that it has built an index of the space.
- 44:01It's with the term, it's an archery.
- 44:04It's super fast to say, show me the things that are near here or are right here.
- 44:08Precisely.
- 44:09Yes.
- 44:09So if you're zooming in and no longer, as I talked about earlier, by default, DataShader has to scan through the entire dataset each time, even if you're zoomed in to just a little spot.
- 44:19With spatial indexing, you can say, okay, this stuff is definitely not in my viewport.
- 44:23I don't need to consider it.
- 44:24And so it becomes faster as you zoom in.
- 44:26Right.
- 44:26If you look at that notebook, you kind of start by loading the dataset, data shading it, and we start with just simple linear aggregation.
- 44:34And what you'll immediately notice is that it's just black.
- 44:38If you think about the population in the US, there's a few hotspots, but New York is super dense.
- 44:43All the cities are kind of dense, but New York is particularly dense.
- 44:46And so all you see with linear color mapping is basically New York and then a few kind of blurry cities.
- 44:52A little bit of LA, a little bit of Chicago.
- 44:54That's about it.
- 44:55Yeah.
- 44:55And so the nice thing about DataShader is that it kind of takes away that you can do linear, you can do log, or you can kind of adjust the color map.
- 45:04And that's all kind of difficult.
- 45:05But by default, DataShader actually does something called EQHist, which is histogram equalization, which means that it kind of adjusts the histogram of the color map in such a way that the lowest number of...
- 45:18It's hard to explain.
- 45:19But it kind of equalizes the color map in such a way that actually...
- 45:22It's a picture over audio only.
- 45:24Yeah, it's a hard one.
- 45:25But basically it reveals the shape of your data, if not the exact values.
- 45:29So you shouldn't use it for reading out the exact values of something, but to get an overall idea of something, it's a really nice mechanism.
- 45:37And that kind of is part of what makes like...
- 45:39If you look at the DataShader image, or you like...
- 45:42Sometimes on Twitter, I'll see like an image, and it just pops.
- 45:45And that's the EQHistogramming color section.
- 45:49Makes sure that you see the overall shape of your data, not the exact values.
- 45:53And this kind of goes through that example, goes through that, and kind of explains what does this actually do.
- 46:00So in the census data, you can see the shape of each city now.
- 46:03You can see kind of a lot of the non-inotonous area in the west of the U.S.
- 46:08It's kind of empty.
- 46:09And yeah, it really reveals like the population distribution in the U.S.
- 46:13And then it also kind of demonstrates how to manipulate your color map to kind of show the hot spots, especially.
- 46:20So you can kind of...
- 46:22Because you've now aggregated into a fixed-dice image, you can say values above this density, you call it in red.
- 46:29And so you really get the cities to pop out.
- 46:31Yeah, very cool.
- 46:32And then maybe I won't go into too much detail on this one anymore, but do check it out.
- 46:36Sure, sure.
- 46:37But it really builds up.
- 46:38People can check it out.
- 46:39I'll link to it.
- 46:39And each one of these steps like builds up with just like a line or two of code.
- 46:43It's not super complicated.
- 46:44Exactly right, yeah.
- 46:45And then we kind of explore kind of depressing facts.
- 46:48So this dataset has basically the race of all the individual people.
- 46:52And you can really see the segregation in different cities.
- 46:55It's horrible to think about.
- 46:57Yeah, that's not good.
- 46:58Yeah, it really reveals the fact if you look at it.
- 47:01Wow.
- 47:01Yeah, I see.
- 47:02And then finally, it rounds out with like showing you how to...
- 47:05Because our tools are meant to work well together, the final example kind of demonstrates how
- 47:09to take this data and use HoloViews to generate an interactive plot where if it was running on
- 47:16a server, so on the website, you're not going to be able to zoom very much, kind of gets very pixelated.
- 47:21But if you're running it on your own in a notebook yourself, or you deploy it to a server panel, for example, then you can zoom around and pan and zoom into individual people.
- 47:31Yeah, wow.
- 47:32Yeah.
- 47:32Wow.
- 47:32That's wild.
- 47:32Yeah.
- 47:33So maybe there's a whole bunch of examples over at examples.pyviz.org.
- 47:37And each one of the examples is tagged with the various libraries that people might want to explore.
- 47:41So there's a bunch here.
- 47:42People can just go there and dig into them and check it out.
- 47:45And this is just one of them.
- 47:46Yeah.
- 47:46And we're trying to keep those up to date.
- 47:48And if you build a cool thing, please submit it.
- 47:50Yeah.
- 47:50Awesome.
- 47:50All right.
- 47:51I guess maybe you could just touch really quick on awesome-panel.org and then tell us what's next with the whole project and probably be out of time then.
- 47:59I've been super happy to see.
- 48:00So community building is hard.
- 48:02And I think many open source developers realize this.
- 48:05And we're definitely still learning.
- 48:07But there's been quite a lot of interest in panel.
- 48:10And Mark Skroth-Matson, who works in Denmark, built this website called awesomepanel.org,
- 48:18which really kind of tries to show off what you can build with panel.
- 48:21So our examples kind of try to focus on the simpler stuff.
- 48:24But awesomepanel really shows you what you can do.
- 48:26And it's really impressive what he's done with panel on awesomepanel.org.
- 48:31Has lots of resources for how to best leverage things.
- 48:35And a lot of stuff, ideally, would migrate back to our website.
- 48:38But yeah, he's built this complex multi-page site, which takes you through a lot of different ways of using panel and has a lot of examples.
- 48:47Yeah.
- 48:47Cool.
- 48:47It's kind of meta, right?
- 48:48Like panels involved in it as well?
- 48:50Oh, yeah.
- 48:50It's built on panel, right?
- 48:52A website that's built entirely in panel.
- 48:54About panel.
- 48:54But also about panel.
- 48:56And yeah, I've been trying to take that further as well.
- 48:58So recently, I did a talk for our AnacondaCon, which is our conference here at Anaconda.
- 49:04And I built the entire presentation.
- 49:06I built a presentation tool on top of panel.
- 49:09Demo panel.
- 49:10Yeah.
- 49:10Awesome.
- 49:11Very, very cool.
- 49:12All right.
- 49:13So what's next with the whole project?
- 49:14Where are you guys going?
- 49:15So one thing that we've kind of been working on recently a lot is in terms of HoloViews is we've added link selections.
- 49:22So you can now, in the spirit of shortcuts, not dead ends, you can generate your HoloView plots.
- 49:27And if they're all using the same data, you can just say link selections, apply it to these various components.
- 49:33And then it will automatically hook up all the linking between the plots so that when you select on one, all the other ones update.
- 49:39I'm really excited about that.
- 49:40It makes it super easy to build a complex dashboard.
- 49:43Yeah, that's super cool.
- 49:43Unless you dive into the data.
- 49:45Yeah.
- 49:45Cool.
- 49:46And particularly with the GPU support now, you can build like, yeah.
- 49:49With GPU support and data shader, you can now like explore tens of millions or billions of data points using link selections.
- 49:55It's really easy.
- 49:56It's super cool.
- 49:57That's one thing I'm excited about.
- 49:59Okay.
- 49:59Another thing in terms of panel ecosystem I'm excited about is the next release is going to have default templates.
- 50:06And so what that means is panels always have the ability to kind of just put stuff together.
- 50:10You say this thing goes in a row with this thing, like a bunch of widgets go in a row or a column.
- 50:16And then you put plot here.
- 50:18But if you want to have more control, you kind of have to write your own kind of HTML and CSS to lay things out.
- 50:25And you have that ability, you do templates.
- 50:27But the next release is going to...
- 50:29You might not want to exercise it.
- 50:30Yeah.
- 50:31So yeah, that's what we're trying to keep people from, right?
- 50:34We don't want people to have to do that kind of thing.
- 50:36So what we've done now is added some default templates where you basically say, I want this to go in the sidebar.
- 50:42I want to do this to go in the header.
- 50:43I want this to go in the main area.
- 50:44And it looks like a polished website.
- 50:46It's not just a bunch of things on the webpage.
- 50:48It's actually a nice looking thing.
- 50:51So I'm also really excited about that because I think that's something that's been missing.
- 50:55So we've had a lot of cool little demos, but it's like to build a whole nice polished looking dashboard.
- 51:01Yeah, a little more control.
- 51:02And that's kind of bridge that gap.
- 51:04And then the last thing I'm really excited about in this next release of the panel is integrating the other ecosystems.
- 51:10So if you're familiar with Jupyter, you'll know about IPI widgets.
- 51:15And IPI widgets has been like lots of lives have now built on top of Jupyter widgets to kind of, I don't know, there's things like IPI volumes, explore 3D volumes.
- 51:24There's just a whole bunch of lives, right?
- 51:26And it's kind of been a shame that we don't want to have divergent ecosystems, right?
- 51:33And so in this next release, we're going to be able to just put your IPI widget into your panel app or even your Bokey app.
- 51:39So this has been done at the Bokey level since we've built on Bokey.
- 51:41You just dump it in there and it's just feeding on the deployed tornado server or the Bokey server.
- 51:46It'll just work and load the feature to your widgets correctly and hook up all the communication for you.
- 51:52And so now we don't have these two divergent ecosystems anymore.
- 51:55You can just use IPI widgets in panel or you can go the other way and kind of say,
- 52:01well, we've got this deployment system and there's this library called Volal, which kind of serves Jupyter Notebooks as well.
- 52:07And so you can now put your panel app into Volal and just serve that.
- 52:11You just make sure that ecosystems don't diverge and you can use the tools that you want.
- 52:15Yeah, that's nice.
- 52:16Because you don't want to have to have a separate set of widgets for your visualizations.
- 52:20And then people also building them for Jupyter, of course, they would build them for there.
- 52:25Right.
- 52:25So might as well just bring these together.
- 52:27Exactly.
- 52:27So it's been a long effort.
- 52:29And there's still, I'm sure, some issues to find out.
- 52:32But super good to be able to shift that.
- 52:34Yeah.
- 52:35All right.
- 52:35Well, very cool.
- 52:36Great project.
- 52:37Great examples.
- 52:38And it looks like you got a lot of momentum going forward as well.
- 52:41So thanks for bringing all of your experience and talking about what you guys have built there.
- 52:46Thanks so much for having me.
- 52:47It's been really great to talk about this stuff.
- 52:49Yeah, you bet.
- 52:49Before we get out of here, though, you've got to answer the final two questions.
- 52:52If you're going to write some Python code, what editor do you use?
- 52:54Oh, I'm still on Emacs.
- 52:56My professor is now my boss at Anaconda hooked me and I'm still there.
- 53:00Although I do dabble in Gears Code now.
- 53:02Yeah, very cool.
- 53:03And probably some Jupyter as well at some point.
- 53:05Yes.
- 53:06I always have like four JupyterLab tabs open and then Emacs on the side.
- 53:11Yeah, cool.
- 53:11And then notable PyPI package.
- 53:14You got a bunch here already.
- 53:15It's worth saying you can just pip install HoloViz.
- 53:18Oh, there's a bunch.
- 53:18But yeah, I think I've already.
- 53:20Yeah, you can pip install HoloViz, which is kind of a good tutorial.
- 53:24But I really want to take this opportunity to plug some of the underlying libraries.
- 53:28I think X-Ray is awesome.
- 53:30I've already mentioned this.
- 53:31And Dask is awesome.
- 53:32So I really want to plug those.
- 53:33I agree.
- 53:34All right.
- 53:34Very cool.
- 53:35So people are excited about HoloViz.
- 53:37Sounds like it really might solve the problem or help them build some dashboards.
- 53:41Final Call to Action.
- 53:42What can they do?
- 53:43Come visit us at HoloViz.org.
- 53:45There's a tutorial that will take you through the initial steps of using our projects and
- 53:50finally let you build a whole dashboard.
- 53:52So go there, check that out.
- 53:54Also, check out examples.pipiz.org to see what you can do if you master this stuff to build
- 53:59more complex examples.
- 54:00And then message me on Twitter or message our individual projects like HoloViz or panel on
- 54:06Twitter.
- 54:07And if you've got any longer form questions, join us on our discourse, which is at discourse.holoviz.org.
- 54:13Super.
- 54:13All right.
- 54:14Well, it looks like a great project.
- 54:16And I think people build cool things with it.
- 54:18So thanks for sharing it with us.
- 54:19Awesome.
- 54:20Thanks again.
- 54:20You bet.
- 54:20Bye.
- 54:22This has been another episode of Talk Python To Me.
- 54:24Our guest on this episode has been Philip Rudiger and it's been brought to you by Brilliant.org
- 54:29and Datadog.
- 54:30Brilliant.org encourages you to level up your analytical skills and knowledge.
- 54:35Visit talkpython.fm/brilliant and get Brilliant Premium to learn something new every
- 54:41day.
- 54:41Datadog gives you visibility into the whole system running your code.
- 54:46Visit talkpython.fm/datadog and see what you've been missing.
- 54:49Go throw in a free t-shirt with your free trial.
- 54:52Want to level up your Python?
- 54:54If you're just getting started, try my Python Jumpstart by Building 10 Apps course.
- 54:59Or if you're looking for something more advanced, check out our new async course that digs into
- 55:04all the different types of async programming you can do in Python.
- 55:07And of course, if you're interested in more than one of these, be sure to check out our
- 55:11Everything Bundle.
- 55:12It's like a subscription that never expires.
- 55:14Be sure to subscribe to the show.
- 55:16Open your favorite podcatcher and search for Python.
- 55:18We should be right at the top.
- 55:20You can also find the iTunes feed at /itunes, the Google Play feed at /play, and the
- 55:25direct RSS feed at /rss on talkpython.fm.
- 55:29This is your host, Michael Kennedy.
- 55:31Thanks so much for listening.
- 55:32I really appreciate it.
- 55:33Now get out there and write some Python code.
- 55:35Thank you.
- 55:35Thank you.
- 55:37Thank you.
- 55:37Thank you.
- 55:39Thank you.
- 55:39Thank you.
- 55:41Thank you.
- 55:41Thank you.
- 55:42Bye.
- 55:43Bye.
- 55:44Bye.
- 55:45Bye.
- 55:46Bye.
- 55:47Bye.
- 55:48Bye.
- 55:49Bye.
- 55:50Bye.
- 55:51Bye.
- 55:52Thank you.