Latest / Talk Python To Me / #471: Learning and teaching Pandas
Transcript
- 0:00If you want to get better at something, oftentimes the path is pretty clear.
- 0:03If you want to get better at swimming, you go to the pool and practice your strokes and put in time doing the laps.
- 0:09Want to get better at mountain biking? Hit the trails and work on drills focusing on different aspects of riding.
- 0:14You can do the same for programming.
- 0:16Reuven Lerner is back on the podcast to talk about his book, Pandas Workout.
- 0:21We dive into strategies for learning pandas in Python, as well as some of his workout exercises.
- 0:27This is Talk Python To Me, episode 471, recorded July 7th, 2024.
- 0:33Are you ready for your host? Here he is.
- 0:36You're listening to Michael Kennedy on Talk Python To Me.
- 0:39Live from Portland, Oregon, and this segment was made with Python.
- 0:43Welcome to Talk Python To Me, a weekly podcast on Python.
- 0:50This is your host, Michael Kennedy.
- 0:52Follow me on Mastodon, where I'm @mkennedy, and follow the podcast using @talkpython.
- 0:57Talk Python.com.
- 0:58Both accounts over at fosstodon.org.
- 1:00And keep up with the show and listen to over nine years of episodes at talkpython.fm.
- 1:05If you want to be part of our live episodes, you can find the live streams over on YouTube.
- 1:10Subscribe to our YouTube channel over at talkpython.fm/youtube and get notified about upcoming shows.
- 1:16This episode is brought to you by Sentry.
- 1:18Don't let those errors go unnoticed.
- 1:20Use Sentry like we do here at Talk Python.
- 1:22Sign up at talkpython.fm/sentry.
- 1:25And it's also brought to you by Scalable Path.
- 1:28If you're a founder or engineering leader, you know how hard it is to find top-tier developers while keeping costs low.
- 1:35Scalable Path is a software staffing company that helps you build remote dev teams that just fit.
- 1:40Build your team at talkpython.fm/Scalable Path.
- 1:45Before we jump into the interview, I want to let you know that we still have some spots left in my Code in a Castle event.
- 1:51If you're looking to learn some of the premier frameworks and techniques in Python,
- 1:55and you'd like to have a bucket list type of experience while doing so,
- 1:58then check out talkpython.fm/Castle.
- 2:02In October, I'll be running a six-day Python course for an intimate audience in a villa in Tuscany.
- 2:09Half the time we'll be learning Python, and the other half will be exploring the best of what Italy has to offer.
- 2:14Check out the course outline, the excursions, and all the details at talkpython.fm/Castle.
- 2:20Or if you'd like to just shoot me an email, Michael at talkpython.fm, or find me on the socials, and I'm happy to talk about it.
- 2:27Hope to see you there.
- 2:28Reuven, welcome back to Talk Python To Me.
- 2:31How are you doing?
- 2:31I'm doing great.
- 2:33Great to be back here.
- 2:34Nice to see you.
- 2:35Yeah, it's great to see you as well.
- 2:36I'm a little concerned, though.
- 2:38There's some possibilities that maybe my Facebook ads are going to get messed up.
- 2:42We are talking about pandas and pandas internationally, and I heard that you're some kind of animal trafficker.
- 2:49Do you want to start the show with that story?
- 2:51It's out of control.
- 2:51It is the craziest story.
- 2:53So I occasionally advertise on Facebook, advertise my pandas and Python training.
- 2:59And I guess it was like two years ago, I tried doing a little bit more advertising.
- 3:03And basically, I didn't really pay much attention to it until about a year ago when I noticed that when I tried to do some more advertising and it said, you are not allowed to advertise on any meta properties.
- 3:15That's really weird.
- 3:16Like, what did I do?
- 3:17I looked.
- 3:17I could not find any indication of what I'd done wrong.
- 3:20So it says, if you want to appeal, click here.
- 3:22So I clicked here.
- 3:23And within 30 minutes or so, I get email back saying, your appeal has been checked and denied.
- 3:28You will never be allowed to advertise on any meta property again.
- 3:31And this was like, what have I done?
- 3:33Like, what are you teaching?
- 3:35I'm pretty innocent.
- 3:35Some courses and some books.
- 3:37Come on, man.
- 3:38I figured also, I appealed.
- 3:41Someone must have looked through this.
- 3:42Anyway, in poking around online, someone said to me, oh, I was caught by the same thing.
- 3:47It is illegal to sell rare and endangered animals.
- 3:51And they believe that since you were selling Python and Pandas training, then you must have been training in live and endangered animals.
- 3:57And thus, you are banned for life.
- 3:59Well, I said, you know what?
- 4:00I got some, first of all, like nuts.
- 4:02And yet, a great story to tell to my machine learning classes.
- 4:05So good on that front.
- 4:06But I was like, this is easy to resolve, right?
- 4:08I'll just contact someone at Facebook.
- 4:09No one's available.
- 4:11I got to text on my connections, like people I know who work there.
- 4:14And I finally get the answer back saying that for legal purposes, they delete all data that's more than six months old.
- 4:20Something like that.
- 4:21So they could not go back and check to see why I was banned.
- 4:25And thus, this ban really would be for life.
- 4:27So because I waited a while, because it had been like a year between the ban and me noticing.
- 4:31Oh, my gosh.
- 4:33So they couldn't do anything about it.
- 4:34So I was like half laughing and half like, you got to be kidding me about this.
- 4:39And I posted on my blog about this.
- 4:42And you guys picked it up on Python Bytes.
- 4:45It was picked up in a bunch of other places like Hacker News.
- 4:48And about a month later, I checked and it was back.
- 4:51No one told me anything.
- 4:53No one said anything.
- 4:54Just magically and quietly, my account was restored.
- 4:58Running to the press never helps.
- 4:59It never helps.
- 5:00That's right.
- 5:01That's right.
- 5:02But it was so absurd.
- 5:03And I think it was at least like four senior engineers at Facebook who tried to help me with this.
- 5:08And they were all like, we tried.
- 5:09There's nothing we can do.
- 5:10Crazy.
- 5:11It reminds me, honestly, it reminds me so much of my App Store review experience, getting the new Talk Python training mobile apps in iOS, in the apps, in the iOS App Store, in the Google App Store.
- 5:24They were tragically incompetent in their own special way, right?
- 5:30Somewhat malicious, somewhat not malicious.
- 5:32Just like, for example, Apple.
- 5:34I think it was Apple.
- 5:35It could have been.
- 5:35I don't know.
- 5:36Apple or Google.
- 5:37It has to be one of them.
- 5:37Said, you know, we've denied your application to publish this application because you're trying to impersonate in an existing one.
- 5:44I said, what app am I trying to impersonate?
- 5:47Like, it's hundreds of hours of stuff that we've created.
- 5:50Like, they're like, well, first you might be hijacked.
- 5:52So, well, in the description, it says, if you want to learn Python, you can take our courses.
- 5:58Well, there's already an app called LearnPython, and you're trying to impersonate.
- 6:02I'm like, what?
- 6:03Like, it said if you want to learn Python, but there's an app called LearnPython.
- 6:07I'm like, I just, I don't even under, like, my mind is, how do you read that description and think this is a trademark?
- 6:13So, if you come up with an app called, like, Eat at a Restaurant, then no food order delivery place.
- 6:20Yeah, you're going to be acquired by Uber Eats straight away.
- 6:22Exactly.
- 6:23And so, we went, but we, you would think, okay, fair mistake.
- 6:26Like, yeah, yeah, okay.
- 6:27Something caught it.
- 6:27Just like you said, a simple request and a human will look and it'll be fine.
- 6:31No, they're like, well, look, obviously you're doing this.
- 6:33I'm like, obviously.
- 6:34Let's try another scenario.
- 6:35What if I said I wanted to learn to play the guitar?
- 6:38And there was an app called Learn Guitar, but I don't want to learn.
- 6:41It's not, it's not, the title is not Learn Guitar.
- 6:43It's just the act of learning a guitar.
- 6:45How else would you explain it?
- 6:46Like, oh, okay.
- 6:47So, I guess we see, we understand now.
- 6:50You can have that sentence.
- 6:52And it's just, these things are really, and you're at the complete mercy of them.
- 6:56It's really, it's both like comically funny, but it's also like painful because we spent
- 7:01four months building that app.
- 7:02They wouldn't accept for this stupid reason, you know?
- 7:04And they're taking a fair amount of money off the top for whatever people are earning from
- 7:09these apps.
- 7:09It's not like this is a charity or something.
- 7:11What I found amazing with Facebook was there was literally no way to contact a human being.
- 7:17Like, I tried all sorts of searches and forums and on, on, and on.
- 7:22And like, and, and I found a lot of other people who had been caught up in this sort
- 7:27of ridiculous situation, but like, there's no form even to say, hey, I think you made a
- 7:33mistake.
- 7:33Why don't you have a human look at this?
- 7:35Because that would cost them too much, you know, someone's salary.
- 7:38Yeah, absolutely.
- 7:38It's, anyway, I don't want to spend too much time on it, but boy, is that a crazy story?
- 7:42I mean, we're going to be trading in some, we'll be trading in some pandas today.
- 7:46And so I just, I'm going to bleep that part.
- 7:49Every time when the word pandas is said, we're bleeping it out on the YouTube.
- 7:52version.
- 7:52Well, this could be entertaining then.
- 7:54Wow.
- 7:55Ruben was really testy.
- 7:57Like all those bleep, bleep, bleep.
- 7:59No, seriously though.
- 8:01You know, let's, let's catch up.
- 8:04We'll talk about your book.
- 8:05What have you been up to since the last time we spoke?
- 8:08I can't remember the last time I had you on.
- 8:09It's been a couple of years, I think.
- 8:10It's been, it's been some time.
- 8:11Yeah.
- 8:12So I'm continuing to do Python pandas training at companies.
- 8:17Since the pandemic, much more of it is online, just because companies are now used to doing
- 8:22stuff on Zoom, team, WebEx, rather than bringing me there in person.
- 8:26That's fine.
- 8:27So I traveled to conferences rather than to clients.
- 8:29And, you know, it sort of extended my flexibility on that.
- 8:31And I've also been building up my online training stuff, both a whole lot of courses.
- 8:36And I've got an online bootcamp that I run for Python and pandas twice a year.
- 8:39The big thing, which is actually connected to what we're doing here also, is I have a new
- 8:43newsletter called Bamboo Weekly, where I have pandas exercises.
- 8:47It's sort of like the same style as the book, but every week I take a topic and I do it, I
- 8:51do it based on current events.
- 8:52So if there's something going on in the news, I try to find a data set, a real world data set
- 8:56that has something to do with that.
- 8:58And then we try to experiment with that.
- 9:00Yeah, that sounds really fun to see like a real world example every week.
- 9:02Yeah, yeah.
- 9:03So people are like, how do you come up with that?
- 9:05And I say, well, I listen to a lot of podcasts and I read a lot of newspapers and something
- 9:09somewhere, like I read The Economist, for example, and they had this short, cute article about
- 9:15the number of animals that go through Heathrow Airport every year.
- 9:18I was like, wait, there's got to be a data set for that.
- 9:21And sure enough, the Heathrow Airport Authority publishes a data set in CSV of how many animals
- 9:26go through.
- 9:27And it was like 200 horses and one and a half billion butterflies and everything in
- 9:32between.
- 9:32And so it was great fun to sort of play with that data and ask questions about it and give
- 9:39people practice with something that's dirty and messy.
- 9:42I don't mean the animals being dirty, right?
- 9:43Like very messy.
- 9:44Like you need to like really, you know, wrestle with it because that's the only way you're
- 9:47going to improve.
- 9:47So I'm having a lot of fun on all the training front.
- 9:50I definitely see more and more use of, I'm sure this won't surprise you, more and more use
- 9:54of Python in the data space as it just like catches fire there.
- 9:58Yeah.
- 9:58It's just going downhill, picking up speed, isn't it?
- 10:01It's extraordinary.
- 10:02Like I still remember asking people in my intro Python courses, so what are you here for?
- 10:07They're like, yeah, my company's thinking of doing some stuff with data analysis and pandas
- 10:11or at least as data analysis, I knew that even in NumPy before pandas got you out.
- 10:16And me thinking, hmm, I should really learn this stuff because it sounds like it's going
- 10:19to be popular.
- 10:19And holy cow, it's like it's everywhere.
- 10:22And the whole ecosystem is just growing, growing, growing.
- 10:25It's like people are sort of seeing pandas as the like underlying infrastructure on which
- 10:29they build their software tools and their companies.
- 10:32Or even the thing that defines the API on which they can innovate, right?
- 10:36Think DASK or a whole bunch of other things in that space, right?
- 10:40That if you know pandas, chances are, if you're not too crazy, you can like do grid computing
- 10:45by changing the import.
- 10:46It's extraordinary.
- 10:47Just extraordinary.
- 10:48Yeah.
- 10:49Yeah, it absolutely is.
- 10:50And so back to your newsletter, pandas eat bamboo.
- 10:54Is that right?
- 10:54That's so-
- 10:55I understand why you're banned from Facebook.
- 10:56Okay.
- 10:56All right.
- 10:57It was actually my father's idea.
- 10:59I was like, I need a like a catchy name for something.
- 11:02And so he was like, well, what was something with bamboo?
- 11:05I was like, right, right.
- 11:06It's like, you know, it's food for thought and food for pandas.
- 11:09Yeah.
- 11:09Yeah.
- 11:10That's actually really clever.
- 11:11I like it a lot.
- 11:12I like it a lot.
- 11:12So you've been on a journey.
- 11:14You've been on a journey to write a book, right?
- 11:16Yes.
- 11:17I was convinced to do a second one.
- 11:19Right.
- 11:20So I did a book with Manning called Python Workout, which was exercise in Python.
- 11:24And when that finished, they said, so what other topics do you think would be useful?
- 11:29I said, well, I'm doing a lot of pandas and people definitely need a lot of exercise and
- 11:32a lot of practice in that.
- 11:33And so I got to work both collecting the exercises I do with my corporate training and also like
- 11:39coming up with some new ones as I learn new things.
- 11:41Because pandas is so, so, so huge that it's very easy to get lost in there and not even
- 11:46know what are the important topics to learn.
- 11:49And so thanks to like working with people all the time, I sort of see also where they
- 11:53get stuck and where they have problems and where it's really confusing to them.
- 11:56So yeah.
- 11:57So 200 and some odd exercises later.
- 11:59By the way, I'll just tell you why did it come out when it came out?
- 12:02Because I'm terribly bad at deadlines.
- 12:04I said to the Manning people, I really want to have it at my booth at PyCon.
- 12:07They said, okay, big talker.
- 12:09You want it mid-May, huh?
- 12:11So you better have everything done.
- 12:12And they sort of backtracked on the calendar and said, okay, so you better have the whole
- 12:15thing done by December.
- 12:16And then finally I had some like, you know, fire under me and got it done.
- 12:21Awesome.
- 12:21As opposed to, I should get more done.
- 12:22Yeah.
- 12:23The version I actually have in my Apple Books here I pulled up is the Manning Early Access
- 12:28Preview version.
- 12:29But it's out for real now.
- 12:31Yeah.
- 12:31Here.
- 12:31I've even got the paper copy here.
- 12:33Woohoo.
- 12:34Look at that.
- 12:34I know.
- 12:35That's a pretty hefty book, honestly.
- 12:36I still keep looking at it.
- 12:37That's a proper book.
- 12:38It's like, wow.
- 12:39I know.
- 12:39I know.
- 12:40It feels like it's really quite some feeling there to see.
- 12:42I guess I really finished it.
- 12:44Congratulations.
- 12:44So I wanted to talk to you about maybe just kind of falling on with your bamboo idea.
- 12:50Like give us some examples.
- 12:52Give us some problems that people are solving with pandas.
- 12:54And I mean, we're not going to talk through the code super detailed, but you could say like this
- 12:59aspect or this feature of pandas like dot look or whatever is how you access and solve these
- 13:03problems, right?
- 13:04Like, so just kind of exploring that space.
- 13:06I had Wes McKinney on before five episodes ago, something like that.
- 13:09And I was just like, how do you learn pandas?
- 13:11It's like so big, you know?
- 13:13So I've actually changed.
- 13:15Well, let me first say I'm definitely one of those people who thinks you should learn Python
- 13:20before pandas.
- 13:21Like I definitely think that knowing the language well will serve you very, very well in all sorts
- 13:28of weird, small ways necessarily.
- 13:29But at the same time, when you learn pandas, you have to learn that some of the paradigms
- 13:33you learned, like some of the idioms from Python are not appropriate.
- 13:37So I was giving a class in like optimizing pandas, like a short class, we'll call it micro
- 13:42class, like 90 minutes long, about a year or so ago.
- 13:44And at the end, I was like, oh, and by the way, obviously just never do for loops.
- 13:48And everyone's like, wait, wait, wait, what?
- 13:50I said, what do you mean what?
- 13:51And they were like, we were taught in our intro pandas class that you should do a for loop
- 13:56to do anything across the data frame.
- 13:58And I was like, okay, what?
- 13:59How can this be?
- 14:00And so people think that because it's in Python, you should do it the same way.
- 14:06But there are all these different idioms, especially whole vectorization that you need to internalize.
- 14:11Otherwise, as I like to say to people, you should hope to be paid by the hour because like these
- 14:17things are just going to take forever to run.
- 14:19And so people don't necessarily understand sort of how to approach pandas stuff.
- 14:24And then they don't understand sort of, let's see, I mean, I'll give like outline and then
- 14:28we can sort of go into it.
- 14:29Certainly how to access things with .lock.
- 14:32Certainly how multi-indexes work.
- 14:34How to work with the different d types.
- 14:37Because these are things that we don't think about in the standard pandas world each day.
- 14:41The closest analogy would maybe be that where you're working with a dictionary, you want
- 14:46to think about what your keys are going to be.
- 14:47But even then, it doesn't come close to it.
- 14:49So like .lock, people are like, so fine.
- 14:52So .lock is used for retrieving from a series or retrieving from a data frame.
- 14:57But it's so much more than that because you have two parts to it, or potentially two parts.
- 15:01You have the row selector and you have the column selector.
- 15:04And each of those can be an individual name, a list of names, a Boolean series, or even a
- 15:11Lambda.
- 15:11And you can mix and match those in so many different ways.
- 15:13And once you see those options, like your head sort of explodes with, oh, wait, I never thought
- 15:19that I could access my data like that.
- 15:21And then you're like, wait, you can also assign your data like that.
- 15:23And then they're just sort of astonished.
- 15:25Yeah, it's really wild.
- 15:27You know, I think pandas has its own idiomatic style that is different than what you would
- 15:32call pythonic, right?
- 15:34Like it's pandonic.
- 15:35I don't know what the name is, but idiomatic pandas, right?
- 15:38I like that.
- 15:38Where there's things that are specific to pandas, like this vectorization stuff, right?
- 15:44Instead of looping over, right?
- 15:46You know, you think about the Python performance angles or the data science performance angles,
- 15:51right?
- 15:51A lot of the speed that we get out of tools like pandas and numpy and polars and others is,
- 15:56as you take the data, you push it down into some native layer and you just leave it there.
- 16:01And you kind of speak to the native layer from Python and you say, deep down in your insides,
- 16:06you got this thing, multiply all 1 million of them by two or whatever, right?
- 16:10But if you loop over it, you're like converting it out of C into Python objects, then you're
- 16:17operating it, then you're putting it back just 2 million times.
- 16:20All of a sudden, all those benefits are gone.
- 16:22And so certainly learning those types of things.
- 16:25I mean, the vectorization, I think most people get pretty soon, although it sounds like not
- 16:29that's really everyone.
- 16:30I was really like flabbergasted.
- 16:34But there's way more than that, right?
- 16:35There's a whole, that's just probably the most obvious thing.
- 16:38This portion of Talk Python To Me is brought to you by Sentry.
- 16:41Code breaks.
- 16:42It's a fact of life.
- 16:44With Sentry, you can fix it faster.
- 16:46As I've told you all before, we use Sentry on many of our apps and APIs here at Talk Python.
- 16:51I recently used Sentry to help me track down one of the weirdest bugs I've run into in a long
- 16:57time.
- 16:57Here's what happened.
- 16:58When signing up for our mailing list, it would crash under a non-common execution pass, like
- 17:04situations where someone was already subscribed or entered an invalid email address or something
- 17:09like this.
- 17:10The bizarre part was that our logging of that unusual condition itself was crashing.
- 17:16How is it possible for our log to crash?
- 17:19It's basically a glorified print statement.
- 17:22Well, Sentry to the rescue.
- 17:24I'm looking at the crash report right now, and I see way more information than you'd expect
- 17:28to find in any log statement.
- 17:29And because it's production, debuggers are out of the question.
- 17:33I see the traceback of course, but also the browser version, client OS, server OS, server OS version,
- 17:40whether it's production or Q and A, the email and name of the person signing up.
- 17:45That's the person who actually experienced the crash.
- 17:47Dictionaries of data on the call stack and so much more.
- 17:50What was the problem?
- 17:51I initialized the logger with the string info for the level rather than the enumeration dot info,
- 17:58which was an integer based enum.
- 18:00So the logging statement would crash saying that I could not use less than or equal to between strings and ints.
- 18:07Crazy town.
- 18:08But with Sentry, I captured it, fixed it, and I even helped the user who experienced that crash.
- 18:14Don't fly blind.
- 18:16Fix code faster with Sentry.
- 18:18Create your Sentry account now at talkpython.fm/sentry.
- 18:22And if you sign up with the code TALKPYTHON, all capital, no spaces, it's good for two free months of Sentry's business plan,
- 18:30which will give you up to 20 times as many monthly events as well as other features.
- 18:34Accessing things in that way.
- 18:36By the way, you asked before, like, how should people even approach learning pandas?
- 18:40And so I've started thinking about it a little differently based on feedback from people that I would sort of walk through it.
- 18:44Okay, here's a series.
- 18:46Here's a data frame.
- 18:47And after creating some, you know, fake ones with, you know, made up numbers or random numbers,
- 18:52then we'll start reading in files.
- 18:53And then we'll do this.
- 18:55And then we'll get to visualization.
- 18:56And a student of mine said, you know, you're sort of missing the big, like, people miss the big picture doing that.
- 19:02And they want to get the excitement.
- 19:03Why don't you start with read a CSV file, visualize it right there inside of Jupyter,
- 19:08and then people will be so impressed and amazed.
- 19:11And then you fill in the gaps.
- 19:12And so I've started doing that a bit.
- 19:14And I think that has not been a bad approach to catch their attention, give them a sense of what the possibilities are.
- 19:20And like, okay, let's now walk through each of these little pieces and build up to what we saw that first day.
- 19:25And that's been fun.
- 19:27Yeah, I totally agree.
- 19:28That's also something that I really strive for.
- 19:31I don't always do whenever I'm doing presentations.
- 19:33But, you know, just because someone is chosen to sit in a seat for a day-long course or an hour-long presentation doesn't mean that they couldn't use a little inspiration, right?
- 19:43And if you're like, wow, you did those three lines.
- 19:45And now we have this picture.
- 19:46And I understand all that.
- 19:47Like, tell me more.
- 19:48Right?
- 19:48That right there.
- 19:48That's right.
- 19:50Right.
- 19:50Now you have their actual attention the whole time.
- 19:53And they're enjoying it.
- 19:54And it's, yeah, it's so often it's like, well, in order to show you the nice stuff, I got to give you every level of detail.
- 20:00It's like, no, you don't.
- 20:01You're going to make a leap.
- 20:03Don't do it that way.
- 20:05That's right.
- 20:06That's right.
- 20:06And you mentioned, like, three lines of code.
- 20:08One of the amazing things about Pandas is how often you can write very, very little code.
- 20:12But it's, like, getting to that code that takes a while, really taking advantage of it.
- 20:17Yeah.
- 20:17We've been knowing that it's possible, right?
- 20:19Right.
- 20:20Right, right, right.
- 20:21People don't even know.
- 20:21So a lot of times, like, I've been using it now for long enough that I sort of intuit, oh, there's got to be a method that does this.
- 20:29Like, someone has encountered this problem before.
- 20:31And so either there's a method or there's an option or there's an add-on, like, something somewhere that just makes it trivially easy.
- 20:38And that's part of the exploration that I try to do both in the book and the weekly and, like, in my training general.
- 20:43And also, truth be told, I'm constantly learning stuff, right?
- 20:45Like, it's rare for me to teach and not discover some option or some method that I did not know about because it's just so incredibly vast.
- 20:52Yeah.
- 20:52Or Pandas 2 comes out or something like that.
- 20:54Yes.
- 20:55Yes, indeed.
- 20:56I mean, I've been exploring, I mean, tomorrow, tomorrow I head off to Prague for EuroPython,
- 21:01where I'm giving a talk on PyArrow in Pandas.
- 21:04And so I've been looking into that a lot.
- 21:06And, oh, boy, right?
- 21:07I mean, I've been using it for, say, a year or so.
- 21:10But it's amazing.
- 21:11And yet there are all these subtle changes that are happening in Pandas as a result that you need to know about or you need to expect when you use it.
- 21:19But it's another, like, tool in our toolbox that we can pull out to make Pandas more effective, more efficient, deal with larger data, and also interact with other and interoperate with other systems.
- 21:30Yeah, for sure.
- 21:31It's just like, as I said, the whole ecosystem is just exploding.
- 21:33It's really quite something.
- 21:34Yeah, it really is.
- 21:35And I think the Pandas 2 stuff is going to make a pretty big difference, changing, like, the internals away from just tables of numbers, basically.
- 21:41Okay.
- 21:42Let's talk about, so the way I thought we could maybe explore this Pandas workout book is let's just pick some fun exercises that you put together and talk about them.
- 21:53Give us a quick overview of what the workout aspect of this book means anyway.
- 21:57Sure.
- 21:58Sure.
- 21:59So the idea is that you can't learn everything all at once or quickly.
- 22:05That's sort of like working out physically.
- 22:07It's a long haul.
- 22:09It's a long haul.
- 22:10And every day you get a little better, a little stronger, a little more flexible.
- 22:14And so if you see, you know, your Pandas learning journey as it's going to take me several months, not going to take me a day.
- 22:22Then if every day you do a little bit of practice, you learn something new in some new direction, at the end of that journey, you're going to be able to solve many, many more problems in better, more idiomatic and more efficient ways.
- 22:34And you'll be able to put these pieces together in ways that you didn't even expect.
- 22:38So that's the basic idea.
- 22:39And so the book is divided into, I want to say, 12 chapters.
- 22:42I know we sort of rejiggered it at some point where each chapter focuses on a different aspect of Pandas.
- 22:48But it's really sort of the total experience of going through it.
- 22:53And so we have 200 exercises, plus there's like a, for lack of a better term, a midterm and a final.
- 22:59Like a meteor projects that people can go through that people ask for after the Python book.
- 23:04And each exercise then has not only the main exercise where I pose a problem, I give an explanation, I give an answer, note the order.
- 23:11The answer comes at the end, so you won't peek as easily.
- 23:14We talked about putting it in the back of the book and like that just didn't work out so well.
- 23:18So at least you have to wade through the explanation a little bit or turn the page.
- 23:21And then after the-
- 23:22You can buy the one book with the questions.
- 23:24You know, there was talk about that too.
- 23:27Oh, you're serious.
- 23:27Okay.
- 23:27You can buy the answers later.
- 23:29There was definitely-
- 23:30I was joking.
- 23:31Ten times the price.
- 23:32I didn't mean to give anyone ideas.
- 23:34I'm joking.
- 23:34No, no, it's fine.
- 23:36And then like after the answer, we have three, what we call beyond the exercise, which are,
- 23:41okay, now that you've kind of gotten the basics, let's push either on the same data set or even like sort of go farther.
- 23:50And so it's like, that's why we say it's 200 exercises because it's 50 official exercises and other three for each one.
- 23:56And those tend to be much harder.
- 23:58And I don't give a full explanation, although I do give the solution online in a Jupyter notebook.
- 24:01You can download Jupyter for all these things and see how I solved it.
- 24:04Nice.
- 24:05And for many of them, there's a link to the Pandas Tutor.
- 24:08I think, yeah, you've definitely spoken to Philip well in the past.
- 24:10So he is not only a Python Tutor, but Pandas Tutor.
- 24:13He and his team.
- 24:14It's amazing.
- 24:15And so you can just click on a link and it will take you to usually a miniature version of the data set because it's too big for Pandas Tutor.
- 24:22And then you can sort of see the visualization, how these things work.
- 24:26Yeah.
- 24:26I don't think I talked about Pandas Tutor.
- 24:28Maybe I have talked to Philip about it, but I've certainly used it in some of my courses.
- 24:34But it's worth bringing it up just to talk.
- 24:36Like, see how that thing works?
- 24:37It's something special, this thing.
- 24:39It really gives you some deep understanding into like, okay, if I run, you know, this group by command, then here's how all the pieces like flow back together.
- 24:48And so you're using this during your book?
- 24:50So, yeah.
- 24:50So, I mean, every exercise has a link in the solution.
- 24:54You click on it and it brings you to the code that I use.
- 24:56It's usually, again, a sort of miniature version of the code, miniature version of the data set that you can then see the visualization there in your browser.
- 25:04Nice.
- 25:04Yeah, because you've got to basically, I think, encode the data in the URL.
- 25:07So it can't be too much.
- 25:09Right.
- 25:10Right.
- 25:11So I would like basically take the data in the data frame, turn it into a Python dictionary, and then like set it up because it won't work with files for security reasons.
- 25:21Yeah.
- 25:21So assign that dictionary to a variable or no, no, I'm sorry, I turned to CSV in a string and then assign that string to a variable and read it in.
- 25:28And then I would see if it overflowed the pandas work, now pandas tutor limit.
- 25:35And if it did, I sort of iterated until I got it small enough to fit in there and big enough to be useful and interesting.
- 25:40That took a few iterations.
- 25:42That's cool.
- 25:42No, but it's a super, super good resource.
- 25:44For learning pandas, I also think for exploring, right?
- 25:48Like you end up with some code that like, I'm not really sure what this does, or this is actually new to me.
- 25:52Like a lot of things you might encounter in this book.
- 25:54You're like, let me visualize that.
- 25:56Right.
- 25:56Because, yeah.
- 25:57Right.
- 25:57Right.
- 25:57I mean, as I said, like I do a lot of training in pandas and very often people have already played with it a bit, used it, even used it for a year or two.
- 26:06And because it's so large, like it's not unusual for someone to say, oh, I had no idea that this functionality existed.
- 26:13Why have I been wasting my time doing X and Y and Z?
- 26:17I'll give you one example that I've been using more and more.
- 26:20So, you know, Matt Harrison's a big fan of the method chaining approach.
- 26:24And at first I was like, yeah, yeah, yeah, Matt, whatever.
- 26:26Like, yo, stop pushing out on everyone.
- 26:28You and your fluent interfaces.
- 26:30Keep them to yourself.
- 26:31Right.
- 26:31And then I was like, actually, this is a great way to build things up little by little, line by line.
- 26:38And I can use this.
- 26:39It's pedagogically very useful.
- 26:40Because I say, okay, let's think about how we want to break down this problem.
- 26:43We'll do this.
- 26:44Then we'll do this.
- 26:44Then we'll do this and you can see it sort of going line by line until voila, we have the analysis that we want.
- 26:50And so I inserted that into a lot of places in the book.
- 26:53Sort of like one of the last edits that I did was to go back and change it to be more method chaining.
- 26:58And I use it now all the time in my training and in Bamboo Weekly.
- 27:02And so I bow to Matt on that.
- 27:06He was right.
- 27:07And I was stubbornly resistant for no good reason.
- 27:10Yeah.
- 27:10I really like that style as well.
- 27:12You see, it's officially night here where I am.
- 27:14It's just everything switched dark.
- 27:16I just said that yesterday when I was doing office hours and all of a sudden I was sharing my screen and it changed the color.
- 27:22I'm glad I'm not the only one that happens to you.
- 27:25So, yeah, I'm a big fan of the method chaining fluent interfaces.
- 27:29I mean, I would love to even see like Python itself in the standard library adopt that more.
- 27:34Right.
- 27:35Like there's so many things you operate on that will change something, but then it will return.
- 27:39It will not return anything.
- 27:41It's like a void method as much as we have those.
- 27:43Right.
- 27:43It returns none effectively.
- 27:45So you can't say, you know, dot sort, dot this, dot that.
- 27:48You have to like multi-step it.
- 27:50And I would just love to see more of it.
- 27:51But let's talk.
- 27:52Well, I'll just say there on that front.
- 27:55So Candace like does have the option to either get back a new data frame or to say in place equals true.
- 28:02And then it does it locally, like it does it on that data structure and then returns none.
- 28:06And people are consistently convinced that this is faster, more efficient, better.
- 28:11And so I've been like trying to tell people, no, the Python core developers keep saying, do not think that is true.
- 28:17It is not true.
- 28:18And we are getting rid of in place equals true at some point.
- 28:21Stop using it so that you can do method chaining.
- 28:24And so no small number of people, again, in my course, are like, oh, really?
- 28:28I had no idea.
- 28:29I feel like, you know, I'm spreading the gospel as a word.
- 28:34Throw that whole expression in some parentheses and dot yourself away.
- 28:37Let's go.
- 28:38All right.
- 28:38That's right.
- 28:39Let's dot our way on over to exercise seven of the many.
- 28:44And let's just talk about long, medium and short taxi rides.
- 28:48Tell us like kind of like we can only talk so much about the code, but like let's let's talk a bit about it and get people.
- 28:54Like I said, I want to expose people to like what are some of the problems and aspects of pandas that you can use to solve them.
- 29:00Sure.
- 29:00So one of my favorite data sets to work with is New York City taxi information.
- 29:06It's like everyone can identify with it.
- 29:09You understand it.
- 29:10And so this exercise uses a very small subset of that.
- 29:13Maybe we'll talk next about the pandemic taxis, which is a much larger one.
- 29:16But this is just 100,000, no, 10,000, 10,000 taxi rides from like five years ago, six years ago.
- 29:21And the question is, well, how can we divide up this data set, which tells us how long, how far, how much people paid, when they were picked up, all that information.
- 29:31How can we find out like the distance that they went and categorize that?
- 29:37And the reason that this can be useful is we so often have numeric data that we need to put into categories, right?
- 29:42What are best sellers?
- 29:44What are poor sellers?
- 29:45Who are, you know, the most, you know, employee of the year, that sort of thing.
- 29:49There's so many places where turning something into a category will be useful.
- 29:52And so it's very tempting to think, okay, I'll like do some if statements or I'll do some for statements.
- 29:58But actually, pandas provides us with pd.cut, which just does it for us.
- 30:04And this is one of those examples of once you learn it, you're like, oh, wow, I get it.
- 30:09I don't have to have, oh, yeah, I even have here.
- 30:11Like you might think you would want to say, let's set all the categories, you know, to be medium.
- 30:16And then where it's less than two miles, we'll call it short.
- 30:19And where it's greater than 10 miles, we'll call it long.
- 30:21But you can just say pd.cut, we're going to cut it two.
- 30:24We're going to cut it 10.
- 30:25Anything less than two is short.
- 30:27Anything greater than 10 is long.
- 30:28Anything in the middle is medium.
- 30:29Done.
- 30:30Oh, that's interesting.
- 30:31And pd.cut gives you back a new series.
- 30:32This portion of Talk Python To Me is brought to you by Scalable Path.
- 30:37If you're a founder or engineering leader, you know how hard it is to find top tier developers while keeping costs low.
- 30:44That's where Scalable Path comes in.
- 30:46They're a software staffing company that helps you build remote dev teams that just fit.
- 30:51If you're wondering what sets this staffing company apart, well, one big differentiator is their approach.
- 30:57They're founded and run by developers.
- 30:59Scalable Path understands that finding the right developer is not just about technical skills.
- 31:05It's about personality, work ethic, and how well they mesh with your team.
- 31:10Their software architects will take the time to understand your vision and needs and then develop technical challenges for the roles you're looking to hire.
- 31:18And these technical tests are conducted live on video by senior software developers so there's no gaming the system.
- 31:25And Scalable Path takes it one step further.
- 31:27They evaluate each developer's soft skills like communication, attitude, and work style before presenting best suited candidates to you.
- 31:36Scalable Path has built a network of over 35,000 remote developers.
- 31:42No more endless searches or sleepless nights worrying about the right hire.
- 31:45And here's a special offer for Talk Python listeners.
- 31:48You'll get 20% off of your first month.
- 31:51So are you ready to scale your dev team and your business?
- 31:54Get started by visiting talkpython.fm/scalablepath.
- 31:59The link is in your podcast player's show notes.
- 32:01Thank you to Scalable Path for supporting the show.
- 32:05So the way you're doing it is you're setting everything to medium and then you're defining short and you're defining long instead of defining the three categories.
- 32:13So that's like the sort of you might think this would be a good way to do it.
- 32:17And it works, right?
- 32:19As I like to say in my courses, unfortunately, this works.
- 32:21Right?
- 32:23Like so you will get the right answer this way.
- 32:26But if you then like go to the next page here, you'll see that you can just use PD Cut.
- 32:30I see.
- 32:31Yeah.
- 32:32And then you just say, here are the bins.
- 32:34Here are the labels.
- 32:36Go.
- 32:36Well, this goes back to that thing we talked about, like looping over stuff versus just going, this is what I want you to do.
- 32:43Do it 100% deep down inside the best you can.
- 32:47Don't bother me.
- 32:48Just figure it out for me.
- 32:49Right?
- 32:49That's exactly right.
- 32:50And this means that like a whole lot of people have worked on PD Cut and have made it work efficiently, way more efficiently than you or I could do in our code.
- 33:00Presumably.
- 33:01Right?
- 33:02It's not going to be any worse.
- 33:03And it'll probably be a lot better.
- 33:05The other thing is you get back and you can see it sorted at the end, the output of the series you get here.
- 33:11So you feed it a series and you get back a series.
- 33:14And the series looks at first glance like it's a bunch of strings.
- 33:18And so you're going to have short, short, medium, medium, long, long, long, but it's actually not strings.
- 33:21It's actually a category, which is a pandas version of an enum.
- 33:25So really it's very small because it's just integers being stored there.
- 33:29And then those integers are associated with strings.
- 33:31So that's an example of like where they have thought through it.
- 33:34And they've basically said, yeah, we're going to make this more efficient than you would probably think to do on your own.
- 33:38Right.
- 33:39Awesome.
- 33:39Well, I would, you know, to be honest, I've been happy if I came up with that first solution.
- 33:44Just using lock instead of there.
- 33:46That's pretty cool.
- 33:46But this, this cuts is super nice.
- 33:48Yeah.
- 33:48Just to find the boundaries with as bins and then off it goes.
- 33:52Right.
- 33:52Right.
- 33:53And there's an option there include lowest.
- 33:55And so I actually didn't know about this for a while.
- 33:58So I'd be like, okay, so, so think about the bins has to be from some, some, you know, some small number to some large number.
- 34:03And the question is then, well, wait a second.
- 34:05What about that leftmost bin?
- 34:07What about that?
- 34:07Like if it's up to and not including, it's like less than, but not less than equal, then how do I do it?
- 34:12So I would always be like, well, I'll take the min.
- 34:15I'll do like the series dot min minus one.
- 34:18And then it's guaranteed to be lower than that.
- 34:19But no, it turns out the pandas developers thought about this long before I did.
- 34:23And there's an option, a keyword argument you can pass, include lowest equals true.
- 34:26Done.
- 34:27Now it's less than an equal as opposed to just less than.
- 34:29Right.
- 34:30Because all these kind of things, the boundary conditions are always tricky, especially on floating points, right?
- 34:35Oh, yes.
- 34:36Oh, yes.
- 34:37There's probably at least two spacecrafts that have crashed because of this.
- 34:41All right.
- 34:41The next one we want to go to is number 12, Finding Outliers.
- 34:47Yeah.
- 34:47So, you know, it's this is not a book about statistics and I'm not an expert in statistics, but there are a whole lot of statistical ideas that permeate working with pandas.
- 34:58And so it's like, you know, mean, standard deviation, median, understanding sort of how they can differ from one another.
- 35:05Right.
- 35:05And especially the whole mean versus median thing where it's so easy to have a few outliers pull your data up or pull your data down and then sort of fool you.
- 35:14Right.
- 35:15And so often people want to find the opposite.
- 35:17And so often people want to find the opposite.
- 35:18And I've certainly found this, especially with corporate training with like cybersecurity people where they're like, we are always looking for outliers.
- 35:24Like, you know, who was the user who was logging in at unusual times?
- 35:27Right.
- 35:27Who logged in for 20 IP addresses within one minute.
- 35:31Right.
- 35:31That's right.
- 35:33That's not a good person.
- 35:34That's not a good person.
- 35:34They're not good.
- 35:35I'm to tell you just that right now.
- 35:37They just try to be very, very effective.
- 35:39And so and so.
- 35:43So this finding outliers is, OK, let's find out then not who was sort of normal, but like who was abnormal.
- 35:50Right.
- 35:50Who who is exhibiting, you know, unusual behavior.
- 35:54And so here it's like, OK, let's take our set of numbers and let's find out who was more than one standard deviation.
- 36:01I can't remember if it's one or two above the mean or below the mean.
- 36:04And let's just find those values and ignore the sort of normal values.
- 36:08And then we could talk a little about, you know, IQR, the inter-portile range, which is a standard statistical idea that we don't talk about enough, even though it's super useful.
- 36:17Right.
- 36:17People came up with these ideas a long time ago.
- 36:19Oh, here's a fun fact.
- 36:21John Tukey, who came up with a lot of these ideas, he also invented the word bit in computers.
- 36:26Oh, wow.
- 36:26OK.
- 36:27So, yeah, I was like, wow, what a guy.
- 36:29So you can see here then that like I'm going to take the, you know, trip distance.
- 36:34Let's find, you know, trip distance.
- 36:36Let's find where the trip distance is less than the trip distance at the first quarter of the first quarter minus one half times the IQR.
- 36:45Right.
- 36:45Meaning let's take the distance between the first quarter and the third quarter.
- 36:50That's our inter-portile range.
- 36:51That gives us a sense of like where is the bulk, where are the bulk of the numbers?
- 36:55And let's find out who is below that or who is above that.
- 36:58And so it's not surprising if we're looking for taxi distances, you're not going to have a lot of outliers that are very low because you can't go below zero miles in your taxi.
- 37:08But you can go very high.
- 37:10You can go very large.
- 37:11And so looking for those trips that are greater than the 75th percentile plus one and a half times the IQR, we actually find, you know, I see here in front of me, you know, about 1800 taxi rides out of the 10,000.
- 37:24So about 19 percent of the taxi rides are much, much longer than the mean ride.
- 37:28Interesting.
- 37:29And you can use this and you can imagine people in like the New York City Taxi Limousine Commission saying, oh, we can use this to plan, to charge, to, you know, send taxis to different places.
- 37:39Or have a special program for long distance stuff or whatever.
- 37:42Yeah.
- 37:43Right.
- 37:43Yeah.
- 37:44Right.
- 37:44Or if you're Uber, you know where to play.
- 37:45They actually used to have the longitude and latitude of where people were picked up and dropped off.
- 37:50And they got rid of that.
- 37:51And I'm sure both for privacy reasons and because Uber and Lyft can look at that data and say, oh, well, we know now when to send cars where.
- 37:58Although while true, I imagine that that data has been downloaded and archived with geolocation for certain people.
- 38:07You can still get all that old data.
- 38:10It's just the newer stuff that they don't do.
- 38:11And they still do it by neighborhood.
- 38:12I see.
- 38:13I also wonder, like, how precise that longitude and latitude was.
- 38:16Like, you could probably identify which home, like, was going to which other home.
- 38:20Yeah.
- 38:21Now you're getting into a problem.
- 38:22How bad that would look.
- 38:23Yeah.
- 38:23Now you're getting into a shady spot or certain types of establishments, you know, that could be fraught with consequences for the people whose home you've already identified where they were picked up at or all sorts of stuff.
- 38:34Exactly.
- 38:35All right.
- 38:35Fair.
- 38:35Exactly.
- 38:36Fair.
- 38:36That's way more important than whether Uber can lease their vehicles strategically, you know?
- 38:41Right.
- 38:41Right.
- 38:42And they might have some data on their own, too, you know?
- 38:44Nice.
- 38:44Okay.
- 38:45So you can use this IQR under quartile range feature to pull that out here, right?
- 38:51Right.
- 38:51Right.
- 38:52And, you know, we can pull that out and then do simple multiplication.
- 38:55Right at the end of the day, what we're doing is we're pulling out this data and then just doing very, very simple statistical analysis of it.
- 39:02Just to sort of say, how many outliers do we have?
- 39:05How many low outliers?
- 39:05How many high outliers?
- 39:06And you can see this, like, at the end of the day, it's not that complicated in terms of math.
- 39:11Sometimes people are like, well, how much math do I have to know to learn this stuff?
- 39:14I'm like, I can get through it.
- 39:15I promise you.
- 39:16Not that much.
- 39:17It's not that hard.
- 39:18A few basic ideas and you're basically set.
- 39:20Yeah.
- 39:21Very cool.
- 39:21All right.
- 39:21On to the next one, which is endemic taxis.
- 39:25That's a different kind of taxi.
- 39:26So this was actually, so the two studies we looked at so far were with my tiny little 10,000 taxi ride sample from a few years ago.
- 39:36I then took taxi rides from January and July of 2019 and 2020.
- 39:42So four months there.
- 39:43And the question was, I think I actually only looked at July in this exercise.
- 39:48Yeah.
- 39:48July 2019, July 2020, comparing taxi rides.
- 39:51Now, just to remind you, July 2020, not a great time for tourism in New York City or anywhere else.
- 39:58And so the question was, what differences do we see between July 2019 and July 2020?
- 40:04How much did it go down in terms of taxi use?
- 40:09How much less did people pay?
- 40:10And then my favorite part of this was, did people use cash more in 2020 or less in 2020?
- 40:18And so you see, first of all, it's like a decline of something like 80% in terms of taxi rides from 2019 to 2020.
- 40:24Again, not a huge surprise to anyone who lived through the pandemic and like saw what was going on there.
- 40:29And so my gut feeling was, well, no one wanted to touch anyone else or touch anything that anyone else had touched.
- 40:35So clearly people would have used credit cards much more.
- 40:38And no, it turns out.
- 40:39There's that screen, Ruben.
- 40:41You got to touch the OK.
- 40:42That drove me crazy during the pandemic.
- 40:45It's like, I'm going to just do touch lists.
- 40:46And then you like sign it.
- 40:48Are you OK?
- 40:48You're like, mm-hmm.
- 40:50I never thought of that.
- 40:52I guess in Israel, like you just, you just like, you know, do the tapping of your car.
- 40:57You didn't have to sign anything.
- 40:58But yeah, the US, they're like, oh, hit OK to confirm.
- 41:01It's like, OK, I thought we had just escaped me touching this disease-ridden thing.
- 41:05But no.
- 41:06Also, you have to like indicate how much of a tip you want to leave.
- 41:09But that's a whole separate thing.
- 41:10We're at the, I don't know, the car wash.
- 41:13Don't you want to tip the car?
- 41:14No, I don't want to tip the car wash.
- 41:16That's the other thing is you should have looked at tips.
- 41:18Like that could have been interesting, actually, as well.
- 41:21I think, oh, I did.
- 41:22I think, no, I think I did.
- 41:23I definitely looked at tips, but I can't remember what it was like.
- 41:26Around the pandemic, yeah.
- 41:27Because I know a lot of people gave tips to like kind of say thanks.
- 41:29And I was wondering if that would show up, you know, like,
- 41:31thanks for being out here amongst the diseased ones, you know.
- 41:34So it turns out that people used cash more during the pandemic than credit.
- 41:39And I like raised this with my family.
- 41:41I was like, what the heck?
- 41:42I think it was my sister who said, well, everyone who would use,
- 41:46like the people who are sort of higher income earners who use their credit cards more,
- 41:50they were staying home.
- 41:51It's the people who like were forced to go to work who use cash more,
- 41:55who were taking the taxis because they didn't want to take the subway.
- 41:57Like there was like sort of an in-between sort of thing.
- 41:59OK, interesting.
- 42:00You had all these like wild pieces of data and analysis that you can do.
- 42:04And here it was not just like pulling all this data.
- 42:08But one of the big things was also I want to read in a lot of data.
- 42:12I want to read in from two different CSV files.
- 42:14Now what do I do?
- 42:15Right?
- 42:15Because it's very obvious.
- 42:17You read in a CSV file, you get a data frame.
- 42:18You read another CSV file, you get a data frame.
- 42:20But I want to treat those as one.
- 42:22And I want to then be able to distinguish between them.
- 42:24How do I do that?
- 42:25And so sure enough, Pandas has a concat method.
- 42:28And I use concat now all the time.
- 42:30I read in multiple CSV files into multiple data frames.
- 42:35I concat them together.
- 42:36And you concat them either horizontally or vertically, depending on what you want to do.
- 42:40And this comes back to where I said-
- 42:42Their columns are the same, then you might do it vertically.
- 42:44But if you want to augment it potentially, it's like, oh, now we have the sale percentage data,
- 42:49but it goes along with the columns exactly or the rows exactly.
- 42:52Precisely.
- 42:53Okay.
- 42:53Precisely.
- 42:54And so another nice way to do this also is not just read this one and read that one,
- 43:00but you can use a list comprehension with something like glob.
- 43:03Right?
- 43:04So glob.glob on star.csv.
- 43:06Get back a list of data frames and then just hand that to pd.concat.
- 43:10And so that's where knowing Python and be able to pull that out and use those techniques
- 43:15can really, really come in handy.
- 43:16Yeah.
- 43:17Earlier you mentioned, I want to go back to it real quick.
- 43:19You mentioned that learn Python first and then Pandas.
- 43:22A lot of times when I think learn Python, I think, okay, well, learn the language and then
- 43:27learn the standard library to a good degree.
- 43:30And then begin to chop away at the half million things on PyPI that are interesting.
- 43:35You know, and it's like a never ending sort of thing.
- 43:37And then there's, of course, this joke, like I learned Python.
- 43:40It was a good weekend or something like that.
- 43:42Right?
- 43:42Like, how do you, how do you square these two things?
- 43:44But I feel like the amount of Python that you need to learn is mostly centered around the
- 43:49language and really is actually not that much.
- 43:51And then you kind of learn the past, the pandas way.
- 43:54Right.
- 43:54Theoretically, if you wanted to.
- 43:56Right.
- 43:56Right.
- 43:56For sure.
- 43:57Look, I am a big fan of objects and classes and all that stuff.
- 44:01But when I'm talking to people who specifically want to use Python for data analytics with pandas,
- 44:08I say to them, objects will help you, but they're not going to be crucial.
- 44:12Like if there's a part of the course that you want to sort of drop, save some money, save some time, then that's a place where we can save.
- 44:18Because the odds of an analyst using pandas writing their own classes are pretty slim.
- 44:23I think it'll give them some perspective on how these classes work.
- 44:26Sure.
- 44:27But I don't think that like they need to learn that.
- 44:29And like a lot of the standard library there, it's hard to say.
- 44:32Right.
- 44:33So as I said, I love glob.
- 44:34Right.
- 44:35Globbing is fantastic.
- 44:36But that's definitely not in like my intro class.
- 44:40I'm going to say, oh, by the way.
- 44:41Yeah.
- 44:41I would bet there's probably 10 modules that if you knew, you might not need to learn more for six months.
- 44:47You know, doing Jupyter pandas type of work.
- 44:50Right.
- 44:50Like path lib and a couple of things like that.
- 44:53Right.
- 44:53That's right.
- 44:53That's right.
- 44:54I mean, I just made up that number.
- 44:55Yeah.
- 44:56It's mostly like just being able to sort of work with the core data structures, understanding the syntax and how it works.
- 45:02And even like defining some simple functions.
- 45:04Right.
- 45:05I think most people using pandas are not at the end going to define functions.
- 45:09Although as I've gone on with my use of pandas, I see, you know, lambda, this is where it's at.
- 45:15Like knowing how to use it really, really helps.
- 45:17So there I do sort of go back with the pandas people.
- 45:19I'm like, okay, this is going to be super weird.
- 45:21We're going to talk about anonymous functions now.
- 45:24And then, and then like, I typically do that with the more advanced pandas groups, not with the like introductory ones.
- 45:30But if you can sort of wrap your mind around that, then it does help quite a bit.
- 45:34It does.
- 45:34So it takes what would be multiple step things and it lets you turn it into one of those changed expressions.
- 45:40Because instead of defining a function somewhere else, you can just put it in line as part of a lambda and just keep on going, you know?
- 45:45Great.
- 45:46That's right.
- 45:46And the fact that, so, so it's especially useful to find.
- 45:49So we mentioned dot lock earlier.
- 45:51So dot lock allows you to choose rows.
- 45:53Let's start with that.
- 45:54And so I can pass it a lambda and that lambda then gets the data frame you're working on as an argument.
- 46:02And then whatever returns, if it returns a Boolean series, then it allows you to filter.
- 46:07Well, you can then have multiple dot locks and multiple lambdas in a row to do successive filtering.
- 46:13And yes, that is less efficient than doing it all in one fell swoop.
- 46:16But boy, oh boy, it's easier to think about and it's easier to use.
- 46:20So you just like whittle it down, whittle it down, whittle it down each line with its own lambda.
- 46:24And so understanding how to do that, understanding why it's important that the lambda, inside the lambda, you're using the temporary parameter from the lambda as opposed to the overall variable for your data frame.
- 46:36Because you're chaining it, that's useful as well.
- 46:38Well, 100%.
- 46:39And then you can also like comment out certain lines at the end and see what the intermediate values are.
- 46:44And so you say it's less efficient.
- 46:45It's less computationally efficient.
- 46:48It might be more efficient as a human being trying to understand what the heck is happening, right?
- 46:51That is spot on.
- 46:53I often tell people that I think Python is a language for an age in which computers are cheap and people are expensive.
- 47:01Yes.
- 47:02Because like, right, our efficiency is the big bottleneck in terms of time, in terms of money.
- 47:08So, right, if it takes my computer a few seconds more, who the heck cares?
- 47:12Right.
- 47:12My M2 Pro doesn't care if it's like a tiny bit more.
- 47:16I don't care.
- 47:16That's right.
- 47:17That's right.
- 47:18Or my cluster of GPUs, take your pick.
- 47:21Although at that point, it starts to cost real money to burn those things, you know?
- 47:24Right.
- 47:24But still, I mean, depending on that.
- 47:26Look, if you see that your computation is taking a long time, okay.
- 47:29So then you sort of find that and you improve that.
- 47:32Yeah.
- 47:32That's a really good point.
- 47:33Like a lot of things are, don't worry about that until it's actually going to become a problem.
- 47:36It looks slow.
- 47:37It turns out it's probably a blink of an eye.
- 47:39All right.
- 47:39Let's keep moving on.
- 47:41We're getting short on time and we have a plethora of things to work with.
- 47:45I kind of want to go to wine words.
- 47:48Wine words.
- 47:49Wine words.
- 47:50All right.
- 47:50Let me remember what exercise that is.
- 47:52That is 37.
- 47:53All right.
- 47:54Yeah.
- 47:54So people think of pandas, not wrongly, as being great at working with numbers.
- 48:00But it turns out that it's fantastic at working with two other kinds of data types.
- 48:05One is strings and one is dates and time.
- 48:08And you can get a ton, a ton out of analysis working with these if you know how to work with it.
- 48:14So there is, I forget where it is.
- 48:17There's a machine learning archive of data sets.
- 48:23And one of them is 150,000 wine reviews from Wine Magazine.
- 48:28Oh, wow.
- 48:29And so I said, okay.
- 48:30Is it Kaggle maybe or is it somewhere else?
- 48:31I think Kaggle has a version of it, but I think it's elsewhere.
- 48:35Wine Mag.
- 48:36150,000 reviews.
- 48:37Okay.
- 48:38Beautiful.
- 48:39I don't know.
- 48:39I'll find out where it is.
- 48:40Anyway.
- 48:41No worries.
- 48:41So I said, okay, let's find out.
- 48:44Right?
- 48:45Because you drink a bottle of wine and you read the back and you sort of like, you know,
- 48:49roll your eyes at what they've written.
- 48:50Although, although I'll put in a plug.
- 48:52I read this fantastic book a few years ago called Cork Dork by this journalist who decided
- 48:57to become a sommelier.
- 48:58And she took the exam and her journey toward there.
- 49:00She was like, and she convinced me these words actually have real meaning and people are very
- 49:04serious about it.
- 49:05So I will not roll my eyes quite as much anymore.
- 49:07Getting hints of nutmeg, but they're troubling.
- 49:10Yes.
- 49:11They don't belong.
- 49:13So the question was, okay, what about these reviews of wine?
- 49:17What words are people using?
- 49:19And are they using certain words more with California wines and certain words more with French wines
- 49:24or certain words more with red or with white or rosé?
- 49:27And so we can then take this text, break it apart and search for it.
- 49:33We can search for it using plain old Panda stuff.
- 49:35We can search for it using regular expressions, which it has built in and works very well.
- 49:39So here, so let's see.
- 49:42So analysis on the words.
- 49:43Here, so one of the 10 most common words for red wine, right?
- 49:47So how do we do that?
- 49:48Well, we have to take the description and break it apart.
- 49:51And if you're used to using just plain old Python, you're like, oh, well, I guess I'll
- 49:55break that into a list.
- 49:56But now what?
- 49:57Now I have a series of lists.
- 49:58Now what do I do?
- 50:00And so one of the key methods to know here is something called explode.
- 50:03And explode is let's take a series of lists and turn that into a very, very, very long series.
- 50:10And so basically each element in the list becomes an element in the series and they all share
- 50:15an index.
- 50:16So you know where they're originally from.
- 50:18And then, you know, the world's your oyster.
- 50:20So you can get rid of punctuation, right?
- 50:23So I have a S dot stir lower.
- 50:25Okay.
- 50:25So we lowercase everything.
- 50:26Then dot stir split.
- 50:27And we split into a list.
- 50:28Then we say explode, get into a long series.
- 50:30Then we once again run strip, angry with punctuation.
- 50:33And now we can use is in, which is yet another fantastic pandas method to say, are these words
- 50:40in, like find the lines where these words are located.
- 50:43And then we can just do a value count.
- 50:45Definitely my favorite method.
- 50:46How often does this thing show up?
- 50:48And then we use head.
- 50:49Ta-da.
- 50:50We've got the 10 most common words there.
- 50:53And when you break it down like that.
- 50:55The value count sorts probably most common to least common, right?
- 50:59Yeah, yeah, exactly.
- 51:00So value counts, not only does it count how often something shows up, but exactly.
- 51:04It sorts it from most common to least common.
- 51:06So then head is just head.
- 51:07Yeah.
- 51:08However much you take there.
- 51:10And then that's the ones.
- 51:11Those are the popular ones.
- 51:12That's right.
- 51:12That's right.
- 51:13So here I have like, you know, the page we're looking at.
- 51:15So we get find where the country is France.
- 51:17So that's the row selector.
- 51:19And we want the column selector to be description.
- 51:21So we only want the description.
- 51:22And then we have our function top 10 words, which did what I just described.
- 51:26We're going to take these common wine words, lowercase them, get rid of punctuation, so
- 51:29forth, pass it in.
- 51:30And we get back our top words.
- 51:31And we find out what words are used to, you know, are associated with French wines as opposed
- 51:36to California wines and so on and so forth.
- 51:38Excellent.
- 51:39Yeah.
- 51:39Very, very cool example.
- 51:40All right.
- 51:41We, I think we got time for two more to go through.
- 51:44You want to pick two that are popular or you want to leave?
- 51:47let's see.
- 51:48Let's see.
- 51:49Let's do, maybe 32 multi-state.
- 51:54Actually.
- 51:54Hmm.
- 51:55Yeah.
- 51:55Multi.
- 51:56Oh, no, let's do best tippers.
- 51:58Best tippers.
- 51:58Let's do best tippers.
- 51:59Yeah.
- 52:00You mentioned tippers.
- 52:01Oh, you're going to open up a whole, this is going to be a whole thing.
- 52:03Best tippers.
- 52:04Number 42.
- 52:05Let's go.
- 52:06No, no, no judgment here, folks.
- 52:08All right.
- 52:08So the question is like, so we'll try to understand as everybody here when people tip their taxi
- 52:13drivers more generously.
- 52:14All right.
- 52:14So the question was, did they tip better?
- 52:17And we looked at 2019 before the pandemic in January and July.
- 52:21So do they tip more in the winter or do they tip more in the summer?
- 52:24And so this involves several things.
- 52:26First of all, it involved using dates and time.
- 52:29Again, one of these things that pandas is just amazing at that people just are not aware of all
- 52:34the flexibility you have there.
- 52:35Another thing is how easy it is to create a new column, right?
- 52:39So we spoke before a bit how you can use broadcasting to just multiply.
- 52:42I have a column multiplied by something or a column adding to another column.
- 52:46But you can create a new column just by assigning to it.
- 52:48Again, it's sort of like assigning to a dictionary.
- 52:50It just then is there.
- 52:51And so you can calculate the percentage that people tip, put that in a new column and then
- 52:56say, well, let's now group by the month and let's find out.
- 53:01Take the mean or the max or some sort of deviation.
- 53:03Exactly.
- 53:04Exactly.
- 53:05And we can find out whether people tip more on average in January or in July.
- 53:11I honestly don't remember what the answer is, which will hopefully not tick off too many
- 53:18readers.
- 53:19Here we go.
- 53:19Let's see.
- 53:20Oh, here we go.
- 53:21Go back one page there.
- 53:22So 32% of taxi riders in New York don't tip at all.
- 53:25That's right.
- 53:26That was a surprising thing to me.
- 53:28And then I don't remember exactly what it was in a different month.
- 53:31And you're talking summer versus winter.
- 53:33There's probably a tourism angle versus non locals versus tourists.
- 53:37I mean, I know people go to New York and not in the summer, but not as much, I imagine.
- 53:41That's right.
- 53:42That's right.
- 53:42There are all these different factors that, that like, you know, come into it.
- 53:47Yeah.
- 53:47One of the things kind of takeaways I'm feeling as we were talking about all these is like,
- 53:50there's a lot of interesting questions that can be asked and answered really quickly for
- 53:54like sociology and urban planning and all kinds of interesting questions that don't feel like
- 54:00programmer questions.
- 54:01Yes.
- 54:02So, so, you know, I mean, I talked to a lot of people, you probably do too, who are
- 54:06like interested in advancing their careers with Python.
- 54:10And they're like, well, you know, I don't have a computer science background.
- 54:13Can I got a job as a programmer?
- 54:15And their vision of a programmer is either someone working at a startup or at like one
- 54:20of the big companies, Google, Amazon, Facebook, and so forth.
- 54:22I say to them, look, there are an awful lot of people who have great jobs working at supermarket
- 54:28chains and insurance companies in the backroom analyzing data.
- 54:33And they are crucial, but we don't think of them as programmers and in governments and in
- 54:38cities and weather forecasting places.
- 54:39Like everyone nowadays is using data and collecting and analyzing it and having these skills either
- 54:45gives you abilities to do your job better or gives you the ability to move into a new job
- 54:51that you couldn't have done before that is that these places are desperately looking to fill.
- 54:55Yeah, I can't.
- 54:55Yeah, I totally agree.
- 54:56I can't remember which episode it was.
- 54:58I didn't name it right.
- 54:59So there's an episode I did quite a while ago about our programmers and our data scientists
- 55:04and Python data scientists working together.
- 55:06And I think it was the research arm of Kroger, maybe that had like 200 data scientists.
- 55:12Like that's a wow, that's a proper group of data scientists.
- 55:16I mean, a lot of times data scientists, I feel like there's a couple of them for a company
- 55:20compared to a software team or something.
- 55:21No, and I tell people also, you don't like it's worth learning to write and it's worth learning
- 55:27to speak.
- 55:27Not because you're going to be like, you know, a Pulitzer Prize winning writer, not because
- 55:31you're going to be like, you know, whatever prize you would get for like speaking well,
- 55:34just because having these skills makes you more effective at your job.
- 55:38And people who can write a program to suck up some data, analyze it and come back with
- 55:42a result, especially if it's like a public data set that has something to do with what
- 55:47they're working on.
- 55:47They are so much more valuable to their company than they would have been otherwise.
- 55:52Oh yeah, absolutely.
- 55:53So I found it because I have a search engine on Talk Python that searches the transcripts
- 55:58and everything else.
- 55:59If you want to know something people about historical shows, when you hit search, it's not just like
- 56:03the show notes.
- 56:03So scaling data science across Python and R episode 236 with Ethan Swan, Bradley, Bokme,
- 56:12and the company is 84.51 degrees.
- 56:16So anyway, that's...
- 56:17Oh, I've seen that name before.
- 56:18Yeah, yeah, yeah.
- 56:19That's what it was.
- 56:19So people can check that out.
- 56:20They're interested, but...
- 56:22Very, very cool.
- 56:22Yeah.
- 56:23Super cool.
- 56:23Okay.
- 56:24Last one.
- 56:25What are we doing?
- 56:25Let's do cities.
- 56:27Cities.
- 56:28What number is it?
- 56:2943.
- 56:30Okay.
- 56:30Oh, that's right.
- 56:31So I found a few years ago this JSON file containing the thousand largest cities in the United States.
- 56:39So first of all, like good to work with JSON because people need to know how to work with
- 56:44that kind of data.
- 56:44Yeah.
- 56:45Second of all, okay, let's not look at the numbers so much as let's do some plotting.
- 56:51And so I'm going to like make enemies now.
- 56:54I really cannot handle Matplotlib.
- 56:56I find it, it's like so incredibly powerful.
- 57:00And anytime I want to do even the tiniest thing with it, I have to look up the documentation
- 57:04and remind myself how it works.
- 57:05Maybe it's because I don't use it enough.
- 57:07And so I just use the pandas interface for plotting 95% of the time.
- 57:12Let's call it 90% of the time.
- 57:13The rest of the time I usually use Seaborn.
- 57:15So, so I said, okay, let's see if we can do some plotting here of these largest cities.
- 57:20So for example, let's see growth in Pennsylvania cities, like which cities in Pennsylvania?
- 57:25Oh, I'm sorry.
- 57:26Like, let's see a dual bar plot.
- 57:27How many large cities are in each state?
- 57:29Okay.
- 57:30Well, that's a group by, right?
- 57:31So you have to know how to do grouping.
- 57:32You have to know what you're grouping on and what, how to use count as opposed to mean,
- 57:36right?
- 57:36That count even exists.
- 57:37But then if I want to see a bar plot where it's sorted from smallest to largest, you got
- 57:42to know how to do sorting.
- 57:42And then we can do a bar plot.
- 57:44So sure enough, you do a dot plot dot bar on your series.
- 57:47Kablam.
- 57:48You have a bar plot right there.
- 57:50Yeah, that's awesome.
- 57:50And we just get it and like, you know, it's nicely sorted there.
- 57:52Quick takeaways.
- 57:54Holy cow.
- 57:55Does California have more big cities than I realized?
- 57:57And, you know, where's New York and New Jersey?
- 58:00Like it's way down the line.
- 58:01You think of those as having like pretty megatropolis type places.
- 58:04Massachusetts.
- 58:06That's right.
- 58:06That's right.
- 58:07But it's how many cities.
- 58:09Yeah.
- 58:09Right.
- 58:10So, so, so, so right.
- 58:11Right.
- 58:11That's like the, so keep going.
- 58:13So like do a bar plot of a growth in Pennsylvania.
- 58:16So how are we going to do that?
- 58:17Well, wait a second.
- 58:18If we want to do growth, it's a percentage, but it's written in the JSON as number and then
- 58:23percent sign.
- 58:24That's a string.
- 58:25So we're going to have to get rid of the percent sign.
- 58:27And then we're going to have to change the D type from string to a floating point.
- 58:31And then we can sort it and then we can graph it.
- 58:34And so the ads type changing the D type basically is a deep down inside of pandas pars as an
- 58:41integer operation, right?
- 58:42Rather than looping over and parsing or whatever.
- 58:45Yeah.
- 58:45Yeah.
- 58:46Yeah.
- 58:46Yeah.
- 58:46Like basically, I mean, it has to do the looping.
- 58:48It's doing the looping there at, you know, below sea level.
- 58:51Yeah.
- 58:51Below sea level.
- 58:52Yeah.
- 58:53Down by the dead sea.
- 58:53I see.
- 58:54Okay.
- 58:54Got it.
- 58:57And so you see here like this bar plot.
- 58:59Now we have a whole bunch of cities that have gone down in size and a bunch of things gone
- 59:02up in size.
- 59:03And pandas is very happy to, you know, show, show the bar plot there.
- 59:07You know, again, sorted so that we see it from the greatest sort of shrinkage to the greatest
- 59:13growth.
- 59:13Right.
- 59:14With Pittsburgh having the most shrinkage and Allentown having the most growth.
- 59:18I would not guess that.
- 59:19And I would not have either given that like my sister-in-law and brother-in-law live in
- 59:22Allentown and they're like, Oh, Allentown.
- 59:24Actually, but I think that's a common thing that people think there, even though it seems
- 59:29like a perfectly great place to be.
- 59:30Yeah, sure.
- 59:31Funny.
- 59:32Awesome.
- 59:33Well, there's a lot of cool takeaways.
- 59:35One more.
- 59:36Let me show you one.
- 59:37Go to the last one here in this exercise.
- 59:39Okay.
- 59:39You got it.
- 59:40So one of the most important types of plots you can do in data analysis is a scatter plot.
- 59:47And you take your data frame and you say, give me the plot with based on your, you know,
- 59:52the X axis should be this, the Y axis should be that.
- 59:55Well, if we do a scatter plot based on longitude and latitude of the thousand largest U.S.
- 59:59cities, you basically come up with a map of the U.S.
- 1:00:02Yeah.
- 1:00:03How interesting.
- 1:00:03The other thing that you realize is California is technically bigger than a lot of other states.
- 1:00:08So that also counts for Y.
- 1:00:09Oh, yes.
- 1:00:10Yeah.
- 1:00:10Interesting.
- 1:00:11But there's a lot of people in California.
- 1:00:12Good place to be.
- 1:00:13There are a lot of people there for sure.
- 1:00:14If they're willing to pay the sunshine tax, it's nice there.
- 1:00:17Cool.
- 1:00:19All right, Reuben.
- 1:00:20This is really, really excellent.
- 1:00:22I know you want to give a shout out to a couple of exercises from Bamboo Weekly.
- 1:00:26So I'll include those in the show notes as well.
- 1:00:29And people can like take those and jump over and look at them as well.
- 1:00:32That's fine.
- 1:00:33That's great.
- 1:00:33Yeah.
- 1:00:34No, we went through a lot here just during this time.
- 1:00:36Yeah, for sure.
- 1:00:37And as I've discovered, there's basically, I mean, there is an infinite number of these sorts of things that you can do and different permutations of various sorts.
- 1:00:46I mean, we didn't even talk about like, you know, multi-indexing, which opens up literally a whole new dimension of this stuff.
- 1:00:51Yeah.
- 1:00:51But it's great fun.
- 1:00:52It's great, great fun.
- 1:00:53And a lot of the Pandas 2 stuff coming on changes the foundation and opens up more possibilities still.
- 1:00:58Absolutely.
- 1:00:58All right.
- 1:00:59Well, final thoughts.
- 1:01:00Final call to action.
- 1:01:02What do we got here?
- 1:01:03What do you say?
- 1:01:03Well, call to action, I mean, you can take a look at like, I guess my overall courses and so forth at LearnerPython.com.
- 1:01:10Or if you just want to improve your Pandas knowledge, you can look at BambooWeekly.com, the newsletter there.
- 1:01:15Does it cost money or does it just cost an email?
- 1:01:17So it is a paid newsletter, but the first two questions and answers every week are free.
- 1:01:23So like it's usually between five and nine questions each week.
- 1:01:28But even if you don't pay, I still want people to get some Pandas learning improvement practice so they can totally do that.
- 1:01:36Excellent.
- 1:01:36All right.
- 1:01:37Yeah.
- 1:01:37And check out the book, obviously.
- 1:01:38Oh, yeah.
- 1:01:39That too.
- 1:01:39PandasWorkout.com.
- 1:01:41Cool.
- 1:01:41I'll pull this up.
- 1:01:42Yeah.
- 1:01:42Awesome.
- 1:01:43It's actually pretty thick.
- 1:01:44Yes, it is.
- 1:01:45So at the end, I was like, oh, that's why it took a long time.
- 1:01:51Also procrastination, but you know.
- 1:01:53Yeah.
- 1:01:53I'd love to hear from people if they have.
- 1:01:56I always love to hear like, you know, sort of interesting problems, data sets, issues that people are experiencing,
- 1:02:02just so I can sort of figure out what are the next directions for me to explore that I can then try to help people with as well.
- 1:02:08Awesome.
- 1:02:09Well, I appreciate all your help coming on the show, sharing your knowledge, and just riffing on Pandas together.
- 1:02:15It was a lot of fun.
- 1:02:16Excellent.
- 1:02:16My great pleasure.
- 1:02:17Yeah.
- 1:02:17Bye.
- 1:02:18All right.
- 1:02:18Bye-bye.
- 1:02:20This has been another episode of Talk Python To Me.
- 1:02:23Thank you to our sponsors.
- 1:02:24Be sure to check out what they're offering.
- 1:02:26It really helps support the show.
- 1:02:28Take some stress out of your life.
- 1:02:30Get notified immediately about errors and performance issues in your web or mobile applications with Sentry.
- 1:02:36Just visit talkpython.fm/sentry and get started for free.
- 1:02:41And be sure to use the promo code TALKPYTHON, all one word.
- 1:02:44This episode is brought to you by Scalable Path.
- 1:02:47If you're a founder or engineering leader, you know how hard it is to find top-tier developers while keeping costs low.
- 1:02:53Scalable Path is a software staffing company that helps you build remote dev teams that just fit.
- 1:02:59Build your team at talkpython.fm/scalablepath.
- 1:03:03Want to level up your Python?
- 1:03:04We have one of the largest catalogs of Python video courses over at Talk Python.
- 1:03:09Our content ranges from true beginners to deeply advanced topics like memory and async.
- 1:03:14And best of all, there's not a subscription in sight.
- 1:03:16Check it out for yourself at training.talkpython.fm.
- 1:03:20Be sure to subscribe to the show.
- 1:03:21Open your favorite podcast app and search for Python.
- 1:03:24We should be right at the top.
- 1:03:26You can also find the iTunes feed at /itunes, the Google Play feed at /play, and the direct RSS feed at /rss on talkpython.fm.
- 1:03:35We're live streaming most of our recordings these days.
- 1:03:38If you want to be part of the show and have your comments featured on the air, be sure to subscribe to our YouTube channel at talkpython.fm/youtube.
- 1:03:46This is your host, Michael Kennedy.
- 1:03:48Thanks so much for listening.
- 1:03:49I really appreciate it.
- 1:03:50Now get out there and write some Python code.
- 1:03:52I'll see you next time.