#372: Applied mathematics with Python Transcript
00:00 Often when we learn about or work with math, it's done so in a very detached style.
00:05 You might learn the rules or techniques of differentiation, for example,
00:09 but how often do you get to apply them to meaningful and interesting problems?
00:14 In this episode, we have Vincent Knight and Grant Palmer on to discuss a wide variety of
00:20 applied and approachable math problems using Python. Whether you're deeply into math or
00:25 not so much, I think there's a lot to enjoy from this episode.
00:29 This is Talk Python to Me, episode 372, recorded June 29th, 2022.
00:34 Welcome to Talk Python to Me, a weekly podcast on Python. This is your host, Michael Kennedy.
00:52 Follow me on Twitter where I'm @mkennedy and keep up with the show and listen to past episodes
00:58 talkpython.fm and follow the show on Twitter via at Talk Python. We've started streaming most of our
01:03 episodes live on YouTube. Subscribe to our YouTube channel over at talkpython.fm/youtube to get
01:09 notified about upcoming shows and be part of that episode. This episode of Talk Python is brought to
01:15 you by Compiler from Red Hat. Listen to an episode of their podcast to demystify the tech industry over
01:22 talkpython.fm/compiler. And we'll see you next time on Twitter. And we'll see you next time on Twitter.
01:34 A quick announcement before we jump into the show. You probably know about our video courses. I'm super
02:00 super proud of them and they're a fantastic educational resource for many people. But sometimes you can
02:06 benefit from a more hands-on, group-based approach. That's why I'm running another online cohort course.
02:13 This one will cover FastAPI, Async Python programming, and MongoDB. However, the structure is different this
02:20 time around. This course will be taught 100% live in person. You'll attend over Zoom and all the sessions will
02:27 include myself as an instructor and your fellow students. It runs from August 8th to August 19th.
02:34 If that sounds interesting, please check out the link in your podcast player show notes or on the episode
02:38 page. And if your company offers educational credits or training reimbursements, you should be able to
02:44 expense this course as well as our regular Talk Python courses. I'll put some links to templates that you can
02:51 use to help with that in the show notes as well. Vince Grant, welcome to Talk Python to me.
02:56 Thanks, Michael. Thank you very much for having us. Thank you.
02:58 Yeah, thanks. Nice to be here.
02:59 Yeah, it's good to have you. Vince, I guess it's welcome back for you, right?
03:02 Yeah, I was on the show a while ago. Big listener, love the show. Yeah, I came here a long time ago to
03:09 discuss one of the game theoretic libraries I work on. So yeah, thanks for having me again.
03:14 Yeah, you bet. I love game theory. It's amazing. We'll touch on that a little bit. We're going to
03:19 do kind of a survey of a bunch of different areas of applied math and how Python and compare that with
03:28 how R might solve those problems, some of the libraries involved, some of the techniques involved.
03:33 So lots of fun things. I'm looking forward to diving into them with you.
03:36 Awesome. Awesome.
03:37 Yeah. Awesome.
03:38 But before we do, maybe we'll kick it off with Grant. You're new. Tell people quickly
03:42 about how you got into programming, Python, math. How do you end up here on this show?
03:46 So I'm a lecturer at Cardiff University in the School of Mathematics. So I learned to program
03:52 when I was doing my PhD. Vince here was actually my PhD supervisor. So I essentially learned
03:58 programming from Vince during that time. Nice.
04:01 Yeah. And during my PhD, I sort of realized or I learned that everything that we'd been able
04:09 to learn during my like master's and stuff, it was all completely doable in open source software.
04:15 And that's kind of where I focused my PhD on then. I sort of, one of my main projects during my PhD
04:21 was building a library to be able to do some of this stuff. And then, yeah, I passed then my PhD.
04:26 What general area was your PhD in? I know, Matt, but what specifically?
04:33 Discretive end simulation was where I specialized during my PhD. But like in conjunction with
04:38 that, some of the other techniques, stuff like Markov chains and curing theory, which are sort
04:43 of different ways of solving the same sort of problem. And that's where I sort of specialized
04:47 in.
04:47 Fun.
04:47 Yeah. Very, very cool.
04:48 We have a running, running joke with Garrett that one of his sub topics in his PhD that he became
04:54 hyper specialized in as PhDs go was, is deadlock. And so it's, there's a tweet came up about a
05:00 question about deadlock and all these jokes that come up. We got very excited. Well, I got very
05:04 excited. Like Garrett, someone's joking about your work.
05:08 That's fantastic. Vince, you've already told your story. Maybe just a quick update. What
05:12 have you been up to in the last couple of years?
05:14 Yes. In the last couple of years, having the pleasure of working with Garrett now,
05:18 now that he's a colleague of mine, but otherwise continuing my work on the actual library, which
05:23 is the library we were chatting about just now. And yeah, I'm still a mathematician at Cardiff,
05:28 where the best part of my job is getting to teach people how to program. And that's something.
05:34 Mathematics is such a cool subject, but in a way you're only ever a theoretical mathematician
05:38 until you can program the stuff you're doing. Even the applied stuff is quite theoretic. And then
05:43 it's once you can code these things that are so powerful, it really kind of releases the magic
05:49 of mathematics for want of a less cringy type of way of saying it. So that's kind of what I really
05:54 enjoy doing and what I keep doing. Kind of what we're going to be talking about today.
05:58 Fantastic. Yeah, absolutely. We're going to touch on a bunch of different manifestations of that.
06:03 Cool. I want to put out a quick disclaimer. We're going to be talking about math things,
06:08 obviously Python things as well on the Python show here. The disclaimer is I have some degrees in math,
06:16 but I have not done anything with them for 20 years. And therefore I know just enough to ask
06:21 bad questions and make poor assumptions. So you all are going to have to keep me on track and just tell
06:26 me, no, no, no, Michael, you were totally misremembering that from your courses 20 years ago.
06:31 The real problem is we might just be on just the other side of that boundary where we could
06:36 confidently give you bad answers. That's the...
06:38 Perfect.
06:40 Asking bad questions is fine.
06:42 If you say it confidently, I'm sure it's going to be...
06:43 Yeah, exactly. Confidently giving bad answers is the problem.
06:45 Yeah, sure. All right, cool. Well, let's kick this off by just talking about what is applied mathematics.
06:54 Because one of the final courses I took, it very much confused me, both in the content and just purely in its title.
07:02 This was a course at UCSD in the PhD program there. The course was titled Applied Abstract Algebra.
07:09 Right.
07:09 I'm like, well, is it abstract or is it applied? Because I really don't... I just... So let's just start out with...
07:18 We're going to be talking about solving applied math problems. Like what the heck is applied math versus
07:22 like what I might do in a calculus class where I'm solving a bunch of like formulaic type of problems
07:28 versus real analysis where I'm chaining theories to derive new ideas or maybe it's numerical analysis
07:35 or stats. Like what... Where are we in the math world?
07:38 Yeah. I think applied mathematics is an interesting kind of like term because in a way it's become a...
07:44 It's become destroyed from its meaning in a lot of cases in that there's a whole area of applied
07:49 mathematics as a subfield of mathematics. That's not necessarily applied in any realistic sense.
07:56 I don't know what you think, Gerd.
07:58 Yeah, yeah. So I think traditionally what applied mathematics was when I was doing my undergrad
08:02 was these sort of physics models where they assume no gravity and they assume no friction
08:08 and stuff like that, which doesn't seem very realistic to me at all.
08:13 Yeah.
08:13 Whereas when me and Vince have been talking about applied mathematics, sometimes that goes
08:18 under another name called operational research or operations research. But we call it applied
08:23 mathematics because we're applying various techniques in mathematics to a situation, a real situation.
08:30 Right.
08:30 I do think not necessarily by definition, but just in general, different techniques that apply
08:35 to the more physics-y problems to the more management-style problems maybe that is there.
08:40 But not by definition. It doesn't have to be like that. It's just that's what people find useful.
08:44 Yeah. In a way, a lot of these labels in terms of the mathematical subfields and things are not terribly
08:51 helpful because they create barriers between these fields. This problem I studied in my PhD where
08:59 it's in pure enumerative combinatorics trying to count these types of matrices. Really a problem
09:05 actually because of all other series of conversations. And the most elegant proof that came for this
09:10 conjecture came from statistical mechanics, whatever that means, but it's a field of mathematical
09:17 physics. And it's where all these boundaries from fields not always are helpful, whereas really the
09:23 techniques are the helpful ones and knowing when to apply them. The definition that we would use for
09:30 the purpose of what we're talking about today in terms of applied mathematics are just without
09:34 necessarily going to an incredibly high level of mathematics where you're talking about the stuff
09:38 that they do at CERN that is certainly applied. There's some very low hanging fruit. I don't know
09:43 if that's the right word. Low hanging fruit of where mathematics can very much-
09:46 Like day to day problems.
09:47 Yeah.
09:48 Exactly. Day to day. And it's where you take these ideas of, you know, in high school where you're told,
09:53 oh, matrices are important because computers can do mathematics really quickly with them, but you
09:58 don't do it with a computer. So, you know, who cares, right? But actually with a matrix, you can really apply these things.
10:03 Yeah. They tell you it's important for computers and then you, yeah, then you proceed to do it by hand for the next two weeks. Yeah.
10:08 Exactly. Exactly. Two weeks if you're lucky. Yeah.
10:11 I wish there was some value to that, but yeah, exactly. You're like, well, I could tell you whether this matrix is singular or not, but I have no idea why I would do that. Right? So this is sort of the next step. Like, well, what would you, if you had that knowledge, that kind of knowledge, what would you do with it? Like what kind of problems could you answer? And some of the examples that you all cover in this book that we're going to highlight a little bit are things.
10:33 Like if you have two businesses that are competing, what choices might they make? Or if no, I know this is extremely theoretical and it's never going to happen, but what if there was like a pandemic and there were people who were sick?
10:47 Probably not that funny, but yes.
10:48 We needed to make weird trade-offs about society. Like, should we shut everybody in a basement? Should we make them behave in different ways? What's the cost versus benefit analysis? And those kinds of things, right?
11:01 These things that without needing too much high-level mathematics, you can describe them mathematically relatively simply. And then just with a little bit of code, you can really do cool stuff with it. Just doesn't take much code, you know, and that's, that's where Python really comes in.
11:17 Yeah, for sure. One of the things that we'll see throughout here is there's a bunch of different examples across these different areas of math and these different types of problems in different libraries that apply to solving them.
11:27 But the thing that's cool is every one of those solutions fits within a couple of pages on the long ones, right?
11:35 For Jupyter Notebooks that have the solutions, plus have some of the output of the answer, right?
11:39 Yeah, yeah, yeah.
11:40 It's not a ton of code, is it?
11:42 No, no, exactly. And that's, this kind of touches on something else that we were going to talk about is the idea that a lot of the time when these things are taught, they're taught with specific pieces of software, mostly commercial pieces of software.
11:58 Yeah, yeah.
12:27 Yeah.
12:28 Yeah.
12:29 Yeah.
12:30 Yeah.
12:30 Yeah.
12:30 Yeah.
12:31 It's, I also think it demystifies things a little bit because if what you do is you go to some expensive, polished piece of software like Maple or something, and you can say, you say, well, I could ask this expensive, complex, huge piece of software a question and it can magically give me the answer.
12:50 Yeah.
12:51 Yeah.
12:51 It's great that you get the answer. And it's great that you know you have this very fancy tool, but it doesn't necessarily reveal a ton of understanding because of it, right?
12:58 An idea that's beginning to form in my head. I was just saying this to Gary and I just haven't fully formed. I think there's a blog post that no one's going to read that I want to write one day about, you know, the ethics of it, about teaching these fancy commercial software. It's why these great companies give out these educational software is that they immediately have lots of users of the software that don't know how to use anything else. And I wonder if ethically as educators, if that's okay.
13:27 I think we should make more of an effort to separate the concept from the software. And I was kind of like saying, like, I don't think we should teach any commercial software. And Darren, you made a good point when we were chatting.
13:38 I don't really have a problem with teaching a particular topic through commercial software, as long as we teach it in a separated way so that you know, once you've formulated the concepts and the ideas mathematically, you can use whatever software you want. In the classroom, we happen to have this expensive license.
13:56 So we're going to have this. But outside of the classroom, there are other things you can use.
14:00 Yeah. Well, I think there's a couple aspects here. One, Vince, you spoke about the ethics of it. Is it the right thing to do to basically reinforce this loop?
14:08 Exactly. Exactly.
14:09 Exactly.
14:09 That entrenches some of these. The other part is, if you're in the UK, or if you're in the US, and you say to your student, probably especially if you're in the US, they're used to getting paid so much. I just paid for both my daughters to go through college. So I'm aware that here you pay a lot for the actual tuition. But many places you'll say to students, what is it in the UK? Is there, how is college, what's the affordability? I know in Germany and other places, but don't know it that well there.
14:37 It's a touchy subject in that tuition fees have just come in.
14:42 And so costs of universities here are equivalent, not far off to in-state tuition in public universities in the United States.
14:52 I think they're not far off.
14:54 But then we get to charge, I'm saying we, very, very not talking about me, but we get to charge whatever we want to a certain extent to people from the European Union.
15:05 And then even more to people from outside of that.
15:07 Actually, I don't even know if that's true about the European Union because of recent events anymore.
15:11 Yeah.
15:12 But yeah.
15:13 So yeah, there's a cost.
15:14 Sure.
15:15 Okay.
15:15 So going back though, my point about the ethics was it's one thing to be in the US or places in Europe where we have a decent amount of money.
15:24 It's another to say to somebody, you have to pay $500 for this software to learn the subject, right?
15:31 Where $500 US might be the yearly income.
15:34 For an employed person and their student.
15:36 It seems like there's a lot of good would be done by building up maybe the missing gaps that force or encourage people to go to this commercial software.
15:45 Building that up rather in the form of SciPy libraries and the Python data science stack in general.
15:54 Absolutely.
15:55 So that it's free, open source and all those things.
15:57 I think that would apply for all subjects.
15:59 I think really close to what we're talking about here is with mathematics, I think it's really frustrating because maybe I'm thinking too purely now.
16:09 And I mean pure of heart, not pure mathematics.
16:12 In terms of like mathematics is just such a clean and minimalistic subject.
16:16 You know, you need a pen and a paper to do it.
16:18 And if all of a sudden we're teaching people to use a pen and paper to do mathematics and saying like, oh, but you can only do it with a pen made by a BIC.
16:26 And don't worry, BIC has given us all this free pen.
16:30 The Mongron pen is the only one.
16:30 Exactly.
16:31 Right.
16:32 And then once you graduate, if you want to write down this idea again, you have to use a BIC pen, but you have to pay for it yourself.
16:38 And I really do think mathematics, the evolution of mathematics and a lot of science, I would argue, is into computing, right, is into getting computers to do it.
16:48 And that extension of using the pen now is to use code.
16:51 And yeah, it's...
16:52 For me, at least, I think one of the important things is that separation of mathematical concepts to software.
16:59 Because it's a lot less of a problem, but there's still a problem going.
17:03 The only way you can do this is by using free open software.
17:06 There are some places, unfortunately, that are not allowed to use open software because they think there's security problems and stuff.
17:12 So if you've only taught open software, then certain, like the NHS, for example, I know they discourage using open software.
17:18 So maybe you then think, oh, I can't do this maths thing anymore.
17:21 But if you've separated the concept from the software, at least you know the concept and you know you've got choices.
17:27 Yeah, absolutely.
17:28 Yeah.
17:28 I think that's very true.
17:30 Separating the concept from the software is key where possible.
17:33 And I think perhaps we don't always do a good job of that.
17:36 And here I am speaking as an industry.
17:38 I think sometimes we often...
17:39 I've been to conversations where people have said, I need to use MATLAB.
17:44 Can you help me with MATLAB?
17:45 But it turned out they wanted to know how to numerically solve a differential equation.
17:48 They didn't want to do MATLAB.
17:49 They just wanted to solve a numeric equation.
17:51 They just did not know that that's what they were doing.
17:55 This portion of Talk Python to me is brought to you by the Compiler Podcast from Red Hat.
18:01 Just like you, I'm a big fan of podcasts.
18:04 And I'm happy to share a new one from a highly respected and open source company.
18:08 Compiler, an original podcast from Red Hat.
18:12 With more and more of us working from home, it's important to keep our human connection with technology.
18:17 With Compiler, you'll do just that.
18:19 The Compiler Podcast unravels industry topics, trends, and things you've always wanted to know about tech
18:25 through interviews with people who know it best.
18:27 These conversations include answering big questions like, what is technical debt?
18:31 What are hiring managers actually looking for?
18:34 And do you have to know how to code to get started in open source?
18:37 I was a guest on Red Hat's previous podcast, Command Line Heroes, and Compiler follows along in that excellent and polished style we came to expect from that show.
18:47 I just listened to episode 12 of Compiler.
18:49 How should we handle failure?
18:51 I really valued their conversation about making space for developers to fail
18:55 so that they can learn and grow without fear of making mistakes or taking down the production website.
19:01 It's a conversation we can all relate to, I'm sure.
19:03 Listen to an episode of Compiler by visiting talkpython.fm/compiler.
19:08 The link is in your podcast player's show notes.
19:10 You can listen to Compiler on Apple Podcasts, Overcast, Spotify, Pocket Cast,
19:15 or anywhere you listen to your podcasts.
19:17 And yes, of course, you could subscribe by just searching for it in your podcast player,
19:21 but do so by following talkpython.fm/compiler so that they know that you came from Talk Python to me.
19:27 My thanks to the Compiler Podcast for keeping this podcast going strong.
19:34 We can dive into the applied math aspects, but I think one other final thing on this is I feel like professors,
19:42 especially as they get older, they've taught a certain way with a certain set of tools for 20 years.
19:48 And you know what?
19:49 That course they wrote, they already have the materials and exercises and all of that.
19:54 And the idea of saying, well, we're going to now throw out this and like grab some new open source library.
19:59 I mean, there's 350,000 libraries on PyPI and they're always changing and turning and something new is coming along.
20:06 And it's maybe a lot to ask, but also maybe not too much to ask to say, look, you should keep up with these things.
20:13 And if there's a new way to present it to your students, not because even some of the ethics stuff,
20:18 but you might be doing a disservice to your student to say, look, the only way that you can solve these problems is with say Fortran,
20:24 or the only way you can do it is with a $2,000 toolbox extension to MATLAB.
20:28 That's the way that you have to go to solve this.
20:30 And here's this, you know, super well-respected professor telling you that's how you do it.
20:34 Well, that's not actually how you do it.
20:35 That's how they've done it for 20 years.
20:37 And so there's a lot of inertia there, right?
20:40 I'm really near what being a lecturer, so maybe I'm being really naive here, but it is an effort to keep up with all this stuff.
20:47 But that's our job.
20:48 Our job is to keep up with the latest maths.
20:51 Anyway, if I was still using, if in 30 years time, I was still using the same maths as I'm using today,
20:56 I wouldn't be doing my job properly.
20:58 So why would, why is the same true with software?
21:00 I think it actually frankly comes back to ethics in that, you know, it's, it's unethical to not make the effort to update your training.
21:08 And if we were talking about doctors and surgeons, they do need to learn new things as the science evolves.
21:13 And I think probably with, with lecturers, professors, higher education, it, it comes back to that dichotomy between research and teaching and how teaching is viewed.
21:23 So, but yes, absolutely.
21:25 I think, you know, in a way I would be disappointed if at the end of my career I'm still teaching Python.
21:30 In a way I'll say, oh, by that.
21:32 Not 2020 Python, but, you know, 2050 Python or whatever it is, right?
21:37 Absolutely.
21:37 Yeah, exactly.
21:38 Oh, Pythons are, you know, I started teaching Python 2.
21:40 Or Python Plus Plus.
21:41 And then I had to figure out how to teach both.
21:43 Yeah.
21:43 And he's having it.
21:44 Exactly.
21:45 Yeah, yeah.
21:46 So you, sorry, I cut you off.
21:47 So you started teaching Python 2 and then now you've moved on.
21:50 And then I had to figure out how to deal with Python 2 and 3 and now I just keep 3 and yeah.
21:55 Yeah, that's, I can't believe that transition took so long, but well, there it is.
21:59 Let's dive into some of the problems and we're going to, more specifically, I'm going to take
22:04 this book that you all created and use it to sort of guide our exploration of both some of
22:10 these problems, how we might solve them with Python and some of the libraries that make it
22:14 possible.
22:14 I guess one of the things that struck me about that journey is that there's not that
22:18 many external packages that are required.
22:21 It's not like, well, this one takes 10 to solve this problem.
22:24 This one takes these complex, these five, if you put them together just right, you get the
22:28 answer.
22:28 So that'll be fun.
22:29 But, you know, tell us a bit about this book, Applied Mathematics with Open Source Software.
22:34 So publisher, this is an academic publisher, which amongst other things means the book is really
22:39 too expensive, but they often just send out emails to people saying, you know, hey, could
22:43 you write a book?
22:44 It's not necessarily a source of flattery, but, you know, got one of these emails and
22:49 Geraint actually had just given a talk at Tycon UK.
22:53 I don't know if you want to say a little bit about the talk you gave.
22:55 Yeah.
22:56 It was very much a precursor to this book where I had given an introduction to the field of
23:01 operational research, which is how we label this certain type of applied mathematics and
23:07 all the different problems that could occur.
23:09 And I think the title of the talk was, there's a library for that because every sort of problem
23:14 that we could come up with, you could pip install a library and in a function or two solve the
23:18 problem, which was a neat little...
23:20 Yeah.
23:20 Oh, there it is.
23:21 There's a neat little...
23:22 That's it.
23:22 Is it?
23:23 Yeah.
23:23 Yeah.
23:23 Yeah.
23:24 I'll link to it.
23:25 Yeah.
23:25 If I can just interrupt, the call for proposals for Tycon UK closes on Saturday.
23:29 So if you're thinking of talking, please submit a talk.
23:33 So yeah.
23:33 And it was just really neat that we had these, like, what we call standard problems.
23:38 It was essentially our postgraduate MSC course that we teach.
23:41 But instead of teaching the maths, there was one or two Python functions that solved it for
23:46 you.
23:46 And then, yeah, that eventually evolved into this book where instead of each little topic
23:52 being a couple of functions, we filled out chapters on some of the theory and, again, tried to
23:57 separate the maths and the programming, emphasizing that by introducing another language, which was
24:02 R, to show that you can do it in two different ways and that the software is independent of the
24:06 problem.
24:06 I think you and I have described it because every now and then, as we were writing the
24:09 book, we kind of stop and go, wait, who's the book for?
24:12 You know, and as we were like making decisions about how exactly to do something, we're like,
24:16 wait, who's the book for?
24:16 And I won't necessarily, well, maybe we should talk about that.
24:19 But I think we've kind of written a book that's meant to be useful to people wanting to get started
24:25 either with the mathematical field problem or with how to actually do it with the code.
24:32 And so every chapter has got the same kind of structure that describes a problem,
24:36 then it describes the basics ideas behind the theory of the problem or the mathematical tools,
24:42 the theory behind the mathematical tools.
24:43 But again, not going into too much depth, kind of what I said before about you don't need to
24:47 understand all of Newton and Leibniz's calculus to be able to kind of predict the outcome of a
24:54 pandemic.
24:55 And then it just solves the problem.
24:57 The original problem, it solves it in two separate ways, using R and Python.
25:01 And the final kind of section in every chapter is pointing at a bunch of literature on it,
25:06 which we thought would be useful.
25:07 Yeah.
25:08 And we're more broadly, you might be able to, these types of problems appear and what you
25:13 might be able to do with it.
25:14 Yeah.
25:14 But the really cool stuff with the publisher is that we had an ongoing kind of conversation
25:17 before the start.
25:18 Garrett and I were both like, well, the book has to be open.
25:22 They've agreed like, oh, there's not a PDF floating around online of the book,
25:25 but all the source files are there.
25:27 So all the late deck files are there.
25:29 There's all the Jupyter notebooks are there with the code.
25:31 We haven't quite gotten all the R markdown files up yet, but they are theoretically all
25:35 there.
25:36 And so the book is very open, which we're happy about.
25:40 Yeah.
25:40 That's great.
25:41 It is very shiny new.
25:43 It still has that new book smell.
25:44 It was released just almost exactly a month ago, right?
25:48 That's right.
25:49 That's right.
25:49 Yeah.
25:50 Keep on saying I've got to have Garant over to celebrate, but we don't get around to doing
25:54 that.
25:54 I had to sign a copy for my nun.
25:57 Oh, nice.
25:59 That's very sweet.
26:00 That's so nice.
26:01 All right.
26:02 Now, before we dive into the various problems in the Python side, while we're still kind of
26:06 talking a little bit high level, this is one of the interesting aspects here is the Python
26:10 and R aspect.
26:12 So when you go through each chapter, which is, I think I agree with you that it's pretty approachable,
26:18 even if you don't have a, you don't have to have like a master's in math or specialize
26:22 in that area for it to make sense.
26:23 It doesn't have, if you don't really want to see a ton of formulas.
26:26 Yeah.
26:26 It's not super intense.
26:27 I think that's our first official review, Michael.
26:29 Pretty approachable.
26:30 It's fantastic to share.
26:31 Yeah.
26:34 Well, like I said, my math, while I said a ton of it is highly rusted, it was pretty approachable
26:40 for me.
26:41 So there's that.
26:41 But maybe just talk about putting R and Python side by side for solving a set of different
26:47 problems.
26:47 What are some of the takeaways either of you got from that?
26:50 One thing we wanted to do here, because we would, well, I would certainly.
26:53 describe myself as a, as a Python person, non-R person.
26:57 I know R, I write R, I've written a book in R, but I would certainly describe myself as
27:01 a Python person in that.
27:02 If you're going to sit down and write something, you would pick Python first.
27:05 I would pick Python.
27:06 Exactly.
27:07 But also, you know, I'm embedded in the Python community.
27:10 I listen to some good Python podcasts.
27:14 I'm a Python person and I can look at some Python code and the joy is that looks very Pythonic,
27:20 right?
27:20 I can, I can, I can tell you that.
27:23 And so we were kind of aware that we didn't want to translate the Python to R when we were
27:28 writing this.
27:29 We wanted to, you know, write this as close to our people as, as we could.
27:34 I don't know if we managed that, but that was something as well that we were aware of.
27:38 It's not just translating languages.
27:40 In Python, yeah, in Python, we have the word Pythonic for idiomatic Python.
27:46 Do you all know, is there a word for that in R or is it just idiomatic R?
27:50 I don't know.
27:52 Yeah.
27:52 I don't either.
27:53 Yeah.
27:54 I think you're right.
27:54 You were going to say something.
27:55 Jump in here.
27:56 So I was going to say, like, as we were writing the book, we noticed that there were certain
28:00 problems, which the R and the Python lined up exactly, not from design, just from, if we
28:06 were going to approach these independently, it is pretty much exactly the same.
28:10 way to solve it.
28:11 There were some problems where we had to reformulate the mathematics because the way
28:17 to do it in R was so different to the way you do it in Python.
28:22 That doesn't mean the math's changed.
28:23 We just had to reformulate it, re-communicate it so that we could write it down in R.
28:28 And then there were some problems, again, where we had to use different mathematics to
28:32 solve it in Python and R because of the availability of libraries and stuff.
28:36 I thought that was really, really neat.
28:37 And I think that emphasizes, again, the separation of concept to software because sometimes you
28:44 did have to do very different things in different softwares.
28:46 My favorite chapter on this is the one that is your specialty, Darren, the discrete event simulation
28:53 chapter, where I forget the name of the two theoretic ideas about discrete event simulation.
28:59 Process-based and what's the other one?
29:02 Yeah, so there's process-based and there's the event scheduling approach.
29:07 There's two different ways of approaching discrete event simulation.
29:10 And the standard library in R to do it is process-based.
29:15 And I don't want to call it the way to do it in Python, but the way we've said in Python
29:20 to do it is by using the Q library, CIW library.
29:24 The only reason Gerard doesn't want to say it's the way to do it in Python is because it's
29:27 using his library, the library that he's maintained around.
29:30 Yeah, nice.
29:33 Both those libraries, I'm pretty sure that underneath, well, I know how Q works underneath, but the
29:39 Simmer, which is the R version, I'm pretty sure underneath they work very, very similarly.
29:44 There's not many ways you could do different ways of discrete event simulation, but the way
29:48 you formulate the problem is very different.
29:51 And going through that in the book and going in Python, you have to take like an overhead
29:57 worldview where you look at the system, whereas in R, you have to take a sort of, you have to
30:03 put yourself in the mind of the customer and go, what is the customer doing right now, rather
30:09 than from a systems point of view, in order to formulate the problem before you could just
30:13 then go and solve it.
30:14 I just thought it was very, very interesting that the way to do it in each language was
30:19 so different.
30:20 And yet probably underneath, it's doing exactly the same thing.
30:22 You get the same answers out.
30:23 You just got to formulate it in a different way.
30:25 Yeah.
30:25 I think that's such a nice example where diversity, and I'm using diversity from the way that languages
30:30 do things.
30:31 I think that's the best chapter in the book, frankly.
30:33 I think that's the best chapter in the book because you not only do things differently
30:38 from a programming point of view, but because you do things differently from a programming
30:41 point of view, the theoretic discussion allows you to kind of, yeah, give a really good
30:46 understanding of these two ways of doing it.
30:48 Yeah.
30:49 Yeah.
30:49 Something else that's kind of worth mentioning about the Python in our bit.
30:52 I don't know if this is a terrible address, but I like tests.
30:55 I don't like trusting in any code.
30:57 I like writing tests all the time.
30:59 And we came to this media thing that we wanted the book to be tested.
31:02 We wanted to know the code was correct in the book, but we wanted to have these two different
31:05 languages.
31:06 And we didn't want to kind of use the standard doc test notation for the Python.
31:09 And then we wanted to find something that would work for the R, et cetera.
31:12 So we actually wrote a little language agnostic doc tester that basically runs through and tests
31:18 all the code in the book for us.
31:20 And theoretically, when we write the second edition and we add Julia as well, it will be up
31:24 to handle it.
31:24 Yeah, I guess Julia is another option that could have possibly shown up in here.
31:29 Pretty interesting.
31:30 I guess it's worth pulling this up.
31:31 It's probably worth pulling up the Stack Overflow friends and putting those in there.
31:38 Yeah.
31:38 Right.
31:38 So we have R.
31:40 We've got, I don't know where these all lie right now, but I would imagine that the graph
31:46 looks a little bit different across these.
31:49 Just for people listening, I would say R is certainly growing.
31:53 It's actually growing pretty healthily compared to many, many programming languages.
31:57 And it's not going crazy, but it's going across.
32:00 And you've got Python, which if anyone's looked in the last couple of years, it's just done
32:05 insane stuff in terms of popularity over there.
32:08 So there's that.
32:09 And then Julia is, it's, I don't know, I can't really read it.
32:12 It's, you know, like point.
32:13 Not quite the same scale.
32:15 0, 1% versus say like 2% for Julia, for R, excuse me.
32:21 And then for 16% for Python.
32:23 There is something to be considered about choosing not just a language because the language has
32:28 a cool way of doing async or its generators are beautiful, but choosing a language for its
32:33 ecosystem as well.
32:34 Yeah.
32:34 And that's where it touches on this here, right?
32:36 But also for the community that's already there, I think.
32:40 Yeah.
32:40 At least in the area of mathematics that me and Vincent are in, I think R and Python are quite
32:47 prevalent, but they're also used in different.
32:49 Maybe their peers there, right?
32:50 Yeah.
32:50 Yeah.
32:51 A little closer than this would show.
32:53 I think they're also used in different ways.
32:54 Would you agree, Vince?
32:55 I would say Python's very, because of PyPy, things like out of the box, there's one library
33:01 to do this and it's their way to do it.
33:04 Whereas with R, people tend to write their own stuff and then upload it to Cran.
33:08 Yeah.
33:09 So you might get lots and lots of different ways of doing the same thing, but each one might
33:14 specialize slightly in a different way.
33:16 Whereas with Python, I feel like there's one library that does it really, really well.
33:21 I think people just use the ecosystems in different ways.
33:24 This portion of Talk Python to Me is brought to you by the Python at Scale Summit.
33:30 The Python at Scale Summit is a conference to highlight innovative big data solutions for
33:35 Python developers and enterprises.
33:37 You'll learn about trends in the Python big data ecosystem, share stories about implementing
33:42 solutions, find out about new innovations, and connect with other data scientists using
33:47 Python.
33:47 The Python at Scale Summit will be a hybrid conference with talks, workshops, and training.
33:53 Of course, there will be networking and social events to connect with other Python professionals
33:57 too.
33:58 Come hear speakers like Matt Rockland from Coiled, Brian Granger from AWS, and many others from
34:04 amazing organizations such as NASA, Capital One, and BCG.
34:08 Get back together with your peers and learn how they're scaling their computation and data analysis
34:13 using Python and the data science stack.
34:16 Register at talkpython.fm/python dash at dash scale.
34:21 When you visit the link, be sure to use the code TALKPYTHON, all caps, to get 15% off your
34:28 tickets.
34:28 That's code TALKPYTHON at talkpython.fm/python at scale.
34:32 The links in your podcast player's show notes.
34:34 Thanks to the Summit for supporting the podcast.
34:39 Yeah, both those two things are often talked as strengths of either library, right?
34:43 The fact that Python has that one way to do things and the set of different ways to do
34:47 string formatting conversation comes up.
34:49 But then the fact that R is kind of like closer to the science.
34:54 I don't know if that's even accurate, but that's the feeling, I guess, is also a strength, right?
34:59 Yeah.
34:59 The reason there's lots and lots of libraries to do the same thing is because they've each
35:02 specialized in something which a new academic has just written a paper on.
35:06 And that's why there's lots of different ways of doing it.
35:08 Yeah.
35:08 All right.
35:09 Sure.
35:09 And maybe, you know, like out in the audience, the ninja says R is really powerful when it
35:14 comes to things like analytics and so on.
35:16 Right.
35:17 So maybe there's certain areas where, you know, there's the libraries you can pick that
35:21 are definitely better.
35:22 Okay.
35:22 Now we talked about the book.
35:24 The book also, as you pointed out, has an open version where you can find it on GitHub,
35:30 which obviously we'll link to.
35:32 And in here for each one of these, you've got some examples, which are basically the, at least
35:38 for the Python side, the Jupyter Notebook examples here.
35:42 So I thought maybe we could sort of talk through a little bit.
35:45 What is the problem?
35:47 And then maybe really first quick, quickly introduce what this area is.
35:52 Cool.
35:52 And then what we can then talk about the problem, the example problem you put out there and some
35:57 of the libraries and techniques there.
35:58 Sure.
35:58 So the chapter two, which you're looking at right there, you say is about a mathematical
36:06 idea called, a mathematical concept called the Markov chain.
36:09 So it's this probability model that you loosely go that you're, as the system go,
36:16 model changes over time.
36:18 The system is in a particular state.
36:20 And then you go with a given probability of being in that state to another state.
36:24 You can go around like that.
36:26 That's not the best explanation I've ever given.
36:28 I've explained that many times.
36:29 That's probably one of my worst explanations.
36:32 But market change can be used to model queues.
36:34 And there's a whole field of mathematics called queuing theory.
36:37 And that is often used as a very applied problem.
36:41 And so the problem we got here is imagine you've got a barber.
36:44 The barber has kind of two decisions, how many chairs they have to cut hair in and how many
36:50 chairs they have to keep people waiting for a chair.
36:53 And obviously that has an impact on the queue, right?
36:56 Of how long people have to wait to get their hair cut.
36:58 And you can use Markov chains to build up a model and find the probability of having to wait
37:03 relatively simply.
37:05 I know, Garen, if you want to clean up what I just said.
37:06 No, yeah.
37:09 So I think the model then would be the second state and the probabilities of going between
37:15 each state from the state unit.
37:16 And that can be written as a matrix.
37:19 And the neat thing then is there's loads and loads of linear algebra techniques, which at
37:24 this point you don't really need to know about.
37:25 But there are linear algebra techniques, which stuff like number can just do for you, which
37:30 if you know which techniques to use, you know how to interpret that as a real life
37:35 interpretation.
37:36 So for example, there's one certain set of equations you can solve using our Markov chain,
37:41 sorry, using our matrix, which will give you the long run probabilities of being in each
37:46 state.
37:46 There's another certain linear algebraic technique, which will give you something else.
37:50 And that's what this is.
37:52 Yeah, nice.
37:53 Yeah, the problem is essentially comes down to solving a matrix equation, which you could
37:57 write down and understand with basic mathematical knowledge.
38:01 And then that can be solved.
38:02 This goes back to what you told in high school, that matrices are great because computers can do
38:05 them fast.
38:06 But then you never actually get to do that.
38:07 You just write down equations.
38:08 But it's just a call to NumPies, the knowledge library.
38:12 You can just solve it immediately for you.
38:14 It's amazing.
38:14 Yeah.
38:15 So the problem here to make this applied or more operational, I guess, that you all put
38:20 out there says you have a barbershop and the shop notices that there's a lot of customers
38:25 who are, they come and the shop is full and the waiting room is full and people just leave.
38:30 And I, you know, since COVID, I've just decided I'm cutting my own hair.
38:33 I can't, it took too long to find a barber or anything that worked.
38:37 And then after that, I kind of figured it out.
38:38 But there used to be this place I would go to and boy, did it need this problem.
38:41 It would be, you would go there and be like an hour and a half wait.
38:45 And, you know, you just, all the time and you never knew.
38:48 But so they would solve it by giving away free beer to people while they wait, which was nice.
38:53 But this one wants to solve it more in a more formal business way where they want to have
38:58 people just wait less.
38:59 So it says you have two barber chairs, there's room for four people in the waiting room.
39:03 There's about 10 customers an hour and it takes about 15 minutes to serve a customer.
39:08 How can we minimize or how do we change things so that we don't have customers leaving because
39:14 they come in, see a full waiting room and take off, right?
39:16 Instead of knocking down a wall and building a bigger waiting room and, or spending a lot
39:22 of money on an extra barber chair and just seeing the effect and maybe five years later trying
39:26 the other way, you can just mathematically model this.
39:29 And this is a good example of, I think what we described as applied mathematics is that you
39:33 can answer these cool questions.
39:35 So you could say, well, maybe we need a bigger waiting room.
39:38 Or maybe we need more barber chairs or something like that.
39:41 Right.
39:41 And then you can make that trade off.
39:42 Yeah.
39:43 So let me find the, this is the numpy, numpy dot lin alg magic.
39:49 And so basically you set it up so that you set up all these scenarios in these constraints
39:53 and then you just say numpy solve it, right?
39:56 That's pretty much it.
39:57 Yeah.
39:58 And mathematically you're, you write down this matrix a and another vector b and you're solving
40:03 the equation ax equals b.
40:04 Most of the code is just getting the matrix set up and the b set up.
40:09 Actually, most of the code is the doc strings.
40:12 And then, and then, yeah, you just use the lin alg dot least squares.
40:15 That's one of many ways you can do it.
40:17 Least squares is actually getting an approximate solution to the linear, linear algebraic equation.
40:22 And there's various reasons why that's a better idea than solving it directly.
40:25 And yeah, it's just, it's basically one line.
40:27 I think one of the neat things about this then is all that maths you sort of learn in school
40:33 or even first year university where you're doing sort of row operations and stuff.
40:38 That's not the mathematics that matters here.
40:40 The mathematics that matters is what is the matrix you need to do that to?
40:44 And once you've done it, how do you interpret the result?
40:46 That is the mathematics.
40:48 It's not the actual operations that you spent so long doing in first year university.
40:54 Yeah, that is a bit ironic.
40:55 That's such a good point, Darren, because I think what is mathematics is an interesting question, right?
41:00 And like, is it being able to differentiate a whole bunch of quadratics really fast?
41:04 Or is it knowing which quadratic you need to differentiate, right?
41:07 And I would argue that it is that, you know, it's knowing what, really knowing what the problem is.
41:14 So that, okay, then the actual specific mathematical technique, well, who cares, right?
41:17 Sure.
41:18 Well, events people so often say, oh, I'm never going to use that.
41:21 I'm never going to do these things.
41:23 I could do that with a calculator or I could do that.
41:25 I think a lot of that might be slightly misplaced.
41:28 I'm not going to say misplaced, but somewhat misplaced focus on some of these things, right?
41:33 Like if you could say, well, spend a little time showing you how to differentiate,
41:36 then we'll show you how to actually solve problems with that instead of just getting,
41:40 you know, more and more complicated techniques that you can apply.
41:44 Yeah.
41:45 Integration's more of a pick and choose, right?
41:47 I like to find which thing applies.
41:49 But still, you know, instead of going deep, deep, deep, deep, deep into that on the first
41:53 year stuff.
41:54 Yeah.
41:55 Yeah.
41:55 You had someone on the show a little while ago called Allen Downey.
41:58 Yeah.
41:59 He writes a lot of really great books.
42:01 And I remember what he said on your show was about, he likes to think of teaching these
42:05 things in the other way that code allows you to do these things immediately.
42:09 So instead of waiting through and waiting and having to have faith that there's going to
42:13 be used to it.
42:14 You can just flip that around, you know, and understand what it is.
42:18 I think there's also a lot of that and what we should be doing.
42:21 Yeah.
42:21 That's a very good point.
42:22 I totally agree.
42:23 All right.
42:23 Wrap this one up.
42:24 You were able to find that it would be better to increase the number of barbers by one than
42:30 increase the waiting room capacity by two.
42:32 Because I think the chance of the shop being full is like 23% if you had something like
42:38 that.
42:38 Yeah.
42:38 Yeah.
42:39 Yeah.
42:39 Versus like 8%.
42:41 Those kinds of things.
42:42 And those are really concrete numbers that you could go to a business and say, you know,
42:47 you hired us to analyze these things.
42:49 We gathered all the necessary information, like average time, you know, how much that might
42:54 vary and those kinds of things.
42:55 And here are your choices and here are what are the rough expected outcomes.
42:59 Like that's really, really valuable information.
43:02 And I am very sure that most barbershops, even chains, don't do this kind of analysis.
43:08 Not necessarily in your algebra going on in barbershops.
43:10 That's an interest.
43:11 That's a bold claim.
43:12 I know.
43:13 And this question, so a lot of the research, Darren, that I do is within healthcare.
43:21 So we work with hospitals solving essentially very similar problems to the one that we've
43:26 just discussed.
43:26 We were keen to avoid too much healthcare because that's what we do so much of.
43:30 But yeah, this, this, if you get rid of the idea of a barbershop, you talk about a ward,
43:34 how many beds are on the ward, how big's the, the party out for ambulances to wait in, et cetera,
43:38 et cetera.
43:39 That, that becomes very important and very powerful and not, not something you need to spend thousands
43:44 of pounds or dollars on licenses for.
43:47 Not, you know, the, the, not necessarily even have a huge understanding of, of the learning
43:52 mathematics.
43:53 It's all right there.
43:54 It's all right there available to anyone.
43:55 Yeah.
43:56 But there's way more at stake in a hospital and healthcare than there is for a, of course,
44:02 yeah.
44:02 A haircut.
44:02 Yeah.
44:03 Okay.
44:03 Let's go on to the next one.
44:06 So the next topic is discrete events.
44:09 So I'll find my way over to that one.
44:12 And y'all introduce this one to discrete event simulation.
44:16 This sounds like this might be somewhat in your wheelhouse, right?
44:19 Yeah.
44:20 So I think discrete event simulations probably, if you're used to programming, this is probably
44:25 the one that probably makes the most sense because it's moving virtual things from the
44:30 place essentially.
44:30 So the question we're answering, we're asking here is very similar to the question we just
44:38 answered with Markov chains.
44:40 But sometimes things are too complicated to be able to formulate that correct matrix or
44:46 the matrix doesn't quite work because the situation is a bit too complicated.
44:49 But what we can do is build a virtual representation of our system.
44:53 And by sampling random numbers, we can move virtual people around our barbershop and look at what
45:00 would happen, right?
45:02 And just observe, collect data, crunch that data.
45:05 And this is what discrete event simulation is.
45:07 It's building a virtual representation of the system, using random numbers to play that
45:13 virtual representation system, and then collect some data about what just happened virtually.
45:17 Okay, excellent.
45:18 So this one, let me set the problem that you all laid out here.
45:20 This is a bicycle repair shop.
45:22 And there's a set of gates or actions or I guess events you might say that it flows through.
45:30 So a bike arrives randomly at a rate of 15 bikes per hour.
45:36 They show up and they say, hey, there's something wrong with my bike.
45:39 And the staff member looks at it and helps them.
45:42 That takes about three minutes.
45:43 But it turns out about 20% of the time, the bikes don't need repair.
45:46 There's like, did you know that there's a thing to just twist here and tighten it?
45:49 All right, go away.
45:50 You're fixed.
45:51 You're cured.
45:52 But 80% of the time, there's something wrong, flat tire, broken chain, whatever.
45:56 And that gets put into a place where they're waiting to work on it.
46:00 And that takes about six minutes, right?
46:02 And then you've got to collect it back.
46:03 The question is, I guess the difference that I see here is there's not an uncertainty of whether or not you want a haircut when you show up at a barbershop.
46:11 There's just the amount of time and where the people are and the actions they might take if it's too full.
46:16 But here you may show up and you may need help or you may not need help and so on, right?
46:21 So there's, is that the difference?
46:22 I suppose that is the difference between these two problems.
46:25 But that's not the reason we would use simulation over Markov chains.
46:29 In fact, the situation we're looking at here could be formulated as a Markov chain.
46:35 The difference I see is that in this situation, you could have an infinite amount of bicycles in your bicycle shop.
46:43 So if we were to formulate that as a Markov chain, we'd have an infinite matrix, which is not terrible to deal with, but you wouldn't be able to deal with it in the way we just did.
46:51 Got it. Okay.
46:51 Talking about the states that I did kind of awkwardly in the previous chapter, it's just how many people are in the shop.
46:58 So there's three people in the shop.
47:00 Well, there's a probability that the next thing that happens is four or the probability that the next thing that happens is two.
47:05 So it's a very straightforward set of states that is finite, as Garen said.
47:11 Here, there's two things to keep track of.
47:14 There's the number of bikes being seen by, waiting to be seen by an inspector, the number of bikes waiting to be seen by the repair shop.
47:19 And that just immediately, the fact that now you've got these two dimensions that can change, just again adds to the complexity and the fact that it's an infinite amount of them.
47:27 Yeah.
47:28 So the reason we would use simulation for this is because it's a more complicated situation for a variety of reasons than what we had before.
47:37 And it would take a really, really big, if not infinite matrix to be able to solve this.
47:41 So why would we go to that effort when we can get quick, easy answers just by virtually playing this?
47:47 These two chapters are paired.
47:48 And actually, there's this, all the chapters are paired in the book for the reason that they are kind of the two similar types of problems from opposite angles.
47:58 And correct me, Garen, if you don't agree, but I think that the two opposite angles about numerical tractability, how much you can do with an exact method, which is what the previous chapter was, versus a more approximative method.
48:13 And it's not always easy to say exactly what you should use one or the other.
48:17 Sometimes it's absolutely clear, but sometimes it's not.
48:19 But there's these pairs of chapters that kind of reflect that, you know, the size of the problem, for want of a better word.
48:25 Very interesting.
48:25 Okay, the fundamental Python bit here is the CIW, or you pronounce that Q?
48:31 Yeah, I call that Q.
48:32 C-I-W, Q.
48:35 It's the Welsh word for Q.
48:37 Q-U-E-U-E.
48:38 It's the Welsh word for that.
48:39 And that's why I call it the library though.
48:41 Fantastic.
48:42 All right.
48:43 And so the idea is basically you state the problem in terms of the arrival rate of events, the inspection or the service distributions in terms of how those flow through there.
48:55 The number of things that can be servicing it and the routing and so on.
48:59 You create a network with the Q library.
49:02 And then you could just ask it questions, right?
49:06 You can tell it to run a simulation.
49:08 You can run it for some amount of time, like eight seconds or so on.
49:13 And it's interesting that it simulates it, that it doesn't exactly solve it, right?
49:19 That's the point of simulation.
49:21 Well, not the point, but like one of the uses of simulation is that we can quite easily simulate something that's too complicated to solve exactly or would take too long to solve exactly.
49:32 But we can quite easily simulate it.
49:33 The trade-off then is because assimilation is essentially streams of random numbers that we do things to, you could get extreme values.
49:41 You could get flukes.
49:43 So you lose accuracy, but you gain efficiency.
49:47 Yeah.
49:47 So the idea is you run it over and over and over again with the randomness playing out there.
49:52 And then you just say, well, what is the most common set of outcomes look like?
49:56 Yes, actually, I guess.
49:57 Yeah.
49:57 Very cool.
49:58 So what did we learn from this one?
50:00 That we could add an extra inspector at the front or we could add an extra repairer.
50:08 And what was the better outcome here?
50:10 So we were measuring was the maximum amount of time a bicycle spends in the shop.
50:16 We wanted to get bicycles out as quick as possible.
50:19 So if we added an extra bicycle inspector, we would reduce our time, maximum time in the shop by quite a lot.
50:28 But if we added an extra repairer, we'd reduce it, but not quite so much.
50:32 So we essentially found that the bottleneck was the inspection desk and not the repairing.
50:36 How interesting.
50:37 And I suspect, maybe this is not true, but I feel like if I was a business, knowing that would not just help me hire the right person, but I think having an inspector type of person would be easier to get.
50:49 Right.
50:50 You don't have to have as great of a skill set to actually be the mechanic that does the repairs.
50:55 So that's really valuable as somebody who runs a bike shop.
50:59 I will also throw out another statement here.
51:02 It's probably true.
51:04 I also suspect bike shops don't employ these techniques, but should.
51:07 They can now.
51:10 They can.
51:12 Well, they can now, honestly.
51:14 I think.
51:15 I believe larger companies probably would.
51:17 Stuff like supermarkets and airports probably would have a team of people behind them doing this, but smaller shops, probably not.
51:23 Yeah.
51:24 Gosh, I'm trying to remember the name.
51:25 Not always, right?
51:26 Would be a little caveat I'd say to Gary.
51:28 We certainly know of lots of examples of big entities, companies, things that make very expensive decisions without doing these sorts of investigations.
51:39 Yeah.
51:39 Yeah.
51:40 Well, you mentioned grocery stores and stuff.
51:42 I had the folks from Kroger, which I think, if not, is the largest, one of the largest chains in the US.
51:49 They have basically an analytics and data science subsidiary called 8451.
51:55 They employ 200 data scientists who do R and Python.
51:59 That's awesome.
52:00 That's not joking around in terms of, you know, where do the bananas go and those types of things, right?
52:06 So you're right.
52:07 The larger companies definitely, definitely invest in that.
52:10 It's the interesting thing about what is data science, right?
52:12 Talking about data scientists in that, are they looking at historic data and identifying things?
52:18 And I suspect that there's no answer to my question here.
52:21 I suspect different data scientists do different things.
52:24 But when you share a data science department, that doesn't necessarily mean they're doing this type of work.
52:29 It might be.
52:29 Absolutely.
52:30 It might be.
52:30 But it might also be diving into the data and understanding and observing as opposed to necessarily modeling possible.
52:37 It could be AI.
52:38 It could be AI and ML.
52:40 It could be a data ETL, just bringing in data and just getting into system.
52:45 Yeah, there's all these different aspects.
52:46 I wonder more about the data science on when do I go from being somebody that uses, say, Python for computation to becoming a data science, right?
52:58 When do I, would you cross the boundary from being a mathematician or a biologist to becoming a data scientist that has some understanding of biology, for example?
53:07 I would argue it kind of goes back to what we were saying earlier about what is an applied mathematician and, you know, at what point are these labels helpful and at what point are they not, right?
53:14 Yeah, exactly.
53:15 Out in the audience, Fritam says, yeah, data science is such a catch-all phrase right now.
53:21 I would agree.
53:21 Also a buzzword.
53:22 So if you're looking for a job, it's a good one.
53:24 All right.
53:26 Let's go on to another one.
53:28 We'll get through as many of these as we can.
53:30 And then we have time for anyway.
53:32 So those two problem areas were paired together.
53:35 Yeah.
53:35 The next area that you focused on is fairly different with differential equations.
53:40 So those two areas that we were just in is the book's got parts and it's two chapters in every part.
53:44 And that was in the probabilistic modeling is what we'd call it.
53:47 It's modeling these probabilistic type situations.
53:49 And here we're in the dynamical systems section.
53:52 And so specifically here, we're looking at a problem where differential equations can be used.
53:56 And we wrote, we started writing this book before the world changed, before COVID happened.
54:03 And I remember coming into our writing sessions.
54:07 I have to say, I really enjoyed writing the book.
54:08 Very glad to have it finished, but I enjoyed writing the book.
54:11 And I said to Gary, Gary, do we need to change this chapter?
54:14 Because this chapter, there's a disease going around.
54:17 I think we call it a cold.
54:18 Yeah.
54:18 Everyone's caught a cold in a small community.
54:21 There's a cost to not being able to work.
54:24 So coined that to have a cold.
54:24 Right?
54:24 And there's a cost, a financial cost to not be able to work.
54:28 Financial cost with a possible cure that would double the rate at which you get better from the cure.
54:35 Is it worth, from the cold, pardon me, is it worth financially to get this cure was the problem.
54:43 And yeah, we were like, should we make this about COVID?
54:45 You know, should we just essentially all the graphs we spent so long looking at that was on the news all the time.
54:51 You know, this is it.
54:51 This is essentially the same thing.
54:53 Yeah.
54:54 Should we make it about COVID?
54:55 And we decided not to, didn't we, Gary?
54:57 We decided to just keep it somewhat abstract.
54:59 But yeah, that's the problem here.
55:02 And yeah, the model is, is a textbook for want of a better word, a textbook model that's often taught when you start learning about systems of differential equations called the SIR model.
55:15 And the SIR model has a population in three groups, susceptible people.
55:21 Sorry, Vince, I think you're talking about a different chapter.
55:23 I am talking about the right chapter.
55:24 Thank you, Gary.
55:26 Thank you, Gary.
55:27 Sorry, I went off on one.
55:28 Thank you.
55:29 That's the next chapter.
55:30 No, no, brilliant, Gary.
55:31 They're similar.
55:32 Yeah, they're similar.
55:33 Very similar.
55:35 This one we wrote, you can write down a differential equation that dictates not a system, but just the number of people that are infected over time.
55:42 And so you can write that down, that differential equation.
55:45 You can get a solution for it.
55:46 Sorry.
55:47 Thank you, Gary.
55:48 Thank you.
55:51 Yeah, no worries.
55:52 This one actually uses an interesting library that I am just fascinated with.
55:57 It's an awesome library.
55:58 Called SimPy, right?
55:59 Yeah.
56:00 Yeah.
56:00 I just had the folks on back in May, not too long ago for this one, Andre and Aaron for this.
56:06 And I did not expect this from Python because it's, I expected NumPy and the linear algebra type things, but not, you know, here is the integral of this solution of this differential equation.
56:20 And here are the steps that I took to get there.
56:22 It is so neat.
56:22 SimPy is an incredible library that just gives you so much of what mathematics is thought to have to be commercial in that you can have all your symbolic stuff.
56:31 So, you know, if you want to know what is X plus X, you don't need to tell the computer what value X has.
56:38 With SimPy, the computer can just understand the concept that X is this mathematical idea.
56:43 And it's incredible.
56:44 And it's a fantastic, fantastic library.
56:47 I think it was when I started teaching programming to our first year cohort, I actually taught SageMath and SageMath is built on top of SimPy.
56:55 But at some point I decided to just teach with SimPy.
56:59 And so that's what we use here.
57:00 That's what we use here.
57:00 We build up the actual numeric solution for the differential equations.
57:04 We find the expression that if you put it into this differential equation, that would be the solution.
57:11 We get an exact solution here.
57:13 It's pretty wild.
57:13 You say the way you set it up.
57:15 I mean, everything about SimPy is wild.
57:17 But the way you set it up here is you say, I'm going to create some symbols like time T or constant alpha or so on or initial conditions.
57:26 And then you say, I'm going to have a function.
57:28 You don't say what the function is.
57:29 You say there is a function called I.
57:31 And then what you define for the thing you're going to work with is you say, sim.equation.
57:37 And you say, the equation is going to be given the derivative of this function of T and T.
57:44 And then it has this expression in there.
57:46 Negative.
57:46 I guess that's probably the, what you're specifying here is this is the derivative, not the equation itself, which is negative alpha times I of T, right?
57:54 This is one of those parts of SimPy that when we teach this to our first years, it allows us to help identify misunderstandings about the mathematics.
58:02 I think programming can often help you understand mathematics better and likewise and vice versa.
58:06 But people often come to study mathematics and don't know the difference between a formula and an equation.
58:12 And an equation has two sides.
58:14 An equation has an equal side in the middle.
58:16 And so what you're creating here is sim.equation.
58:19 Sim.equ takes two variables, a left-hand side and a right-hand side.
58:23 That's actually the name of the parameters.
58:25 So the left-hand side is the derivative of I.
58:28 So it's saying that the speed at which the number of infected people changes over time, that's the left-hand side of your equation, is equal to, and then the right-hand side of your equation, some constant alpha minus some constant alpha, sorry, times the number.
58:42 So the speed is related to the number, and that's really the relationship that defines differential equations.
58:47 Right.
58:47 And in this scenario, you can change the alpha, the rate of recovery, by providing medicine or just letting people do their thing, you know?
58:55 Naturally recovery, absolutely.
58:57 Yeah, yeah, exactly.
58:59 So in here, you say, you know, given these constants, we're going to, you know, get the equation and then you solve it.
59:05 You come up with the actual symbolic solution.
59:08 Symbolic solution.
59:09 Always blows my mind.
59:10 You say sim.dsolve, like, does that solve the differential equation?
59:14 I'm guessing.
59:15 You give it the equation and the initial conditions and stuff, and you're like, where the initial condition is, we defined a function I.
59:22 We didn't say what it is, really.
59:24 But we said at zero, it's the initial condition of like how many people are sick or whatever that turned out to be, which is just...
59:30 All of which are symbols.
59:31 Amazing.
59:31 Everything here is just an idea.
59:33 Nothing's a number.
59:34 Everything is just an idea or a concept.
59:35 Yeah, yeah.
59:36 We don't know anything about it.
59:37 We just know that these are the constraints of the equation.
59:40 And now it gives you, you get the solution and it's, it's an equation.
59:45 Let's see.
59:46 I got to go further down.
59:47 So that's it there.
59:48 It says that...
59:48 It gives you the actual solution and then you start plugging in like the numbers, the different conditions, and it gives you the answers, right?
59:54 Sorry.
59:55 Exactly.
59:55 Yeah.
59:55 You plug in the numbers at the end.
59:57 So we get the cost if you were to purchase the cure would be 700 and the cost without purchasing the cure would be 500.
01:00:04 It's just the overall costing into account productivity, offsetting all the impacts of similar type of decisions that governments all over the world will be making.
01:00:12 And in this particular case, for this cold, Jadier is no, it is not worth getting.
01:00:16 But good care.
01:00:17 Don't tell that to the people who are suffering with a fever.
01:00:20 It's a cold.
01:00:22 This is not like the common cold.
01:00:24 This is a cold.
01:00:25 Yeah.
01:00:27 We found this chapter really, really neat because when we started doing exactly the same thing going, how do we solve this in R?
01:00:35 We realized we had to use a completely different approach.
01:00:38 How do is a bad phrase.
01:00:40 We went looking at R for an equivalent symbolic mathematics package in R.
01:00:45 And there is one.
01:00:47 But really, it's a wrapper for Python's SymPy.
01:00:50 And so we found ourselves writing strings of Python that you pass to R that R passes to SymPy.
01:00:57 And yeah.
01:00:58 Sorry.
01:00:59 Yeah.
01:00:59 I think this is your point now.
01:01:01 That doesn't sound like really like solving it in R.
01:01:03 Exactly.
01:01:05 Exactly.
01:01:05 So then, so we decided, well, no, if we were just to solve this in R, how would you do it?
01:01:11 And as there is no symbolic library, a library for doing symbolic mathematics in R, we solved it numerically.
01:01:18 And that just shows like exactly the same problem.
01:01:21 We get exactly the same answers out.
01:01:23 But the bit in the middle, the solution steps were completely different in both Python and R for those reasons, which I think is really neat.
01:01:31 I think that shows that you're concentrating on the problem.
01:01:35 Rather than the solution steps.
01:01:37 Absolutely.
01:01:38 And what you've learned here is that this function that expresses the cost of people being sick, I of T that we talked about is 100 for 100 people sick.
01:01:48 E to the negative alpha of T, which is, it's pretty awesome.
01:01:52 I mean, there's never, there's almost always a reason to marvel at the number E. Have you all read the book E, the story of a number? Have I mentioned this before?
01:02:01 I don't think I have. No.
01:02:04 This, this book is so good. It just goes back to the history.
01:02:08 Is it good?
01:02:08 Literally of just, oh yeah, yeah. It's, I totally can recommend it. So people can check that out if they're...
01:02:14 E is a ridiculously cool number, right? In terms of, I know Pi gets all the press, but E is a ridiculously cool number.
01:02:20 It's way cooler than Pi. It's way cooler than Pi.
01:02:22 I mean, Pi is cool, but it's, if you are into the change of anything, differential equations, integrations, like it's, there's nothing like it.
01:02:31 I had not heard about that.
01:02:32 We are going pretty long on time here. So I don't, I want to be respectful of your all time and everything.
01:02:37 So maybe, is there any other, the problems or areas or libraries that you've made? Actually, let me, let me pick one here.
01:02:43 Which chapter is the game theory one? Seven or nine? Let's see.
01:02:50 Wait for it. No, it's not.
01:02:54 Just one before that. Yeah.
01:02:55 Or yeah, no, it wasn't before that. Yeah. Got it. Yep.
01:02:57 The missing one is the linear programming one. All right. Game theory.
01:03:01 And the reason I want to pull this up is we talked about you, Brent's library and his application.
01:03:07 How about some Nash pie? I mean, there was a John Nash won the Nobel prize in economics for coming up with, basically proving every, in every game, there was an equilibrium position, which is insane that that's true.
01:03:20 In a 17 page PhD thesis. Yeah. Incredible.
01:03:24 And not bad. Not bad. so quick game theory. What is it? People maybe have heard of it, but they don't really know, or maybe they do know.
01:03:33 I fumbled through the previous one, Gary, but it would make sense for me to take this one.
01:03:36 Yeah. She should.
01:03:37 Right.
01:03:37 So game theory is the study of emergent interactions of if you can kind of make some decisions, describe a system at the lower level, how individuals interact, what happens at, at the higher level. That that's the study of game theory. It's, it's interactive decision-making. A lot of the time you can think of decision-making.
01:03:59 For example, with that barbershop problem.
01:04:02 I've discussed at the first stage of, well, if I had this many chairs or this much waiting room, what's the best thing for me? But there you're the only thing that your decision gets hit back with. If you think of a game of tennis, it's playing against the wall. It's playing against that probability. Game theory is just taking it to a slightly different dimension where you have two barbershops. What if you had two barbershops? And if one does this and the other does that, where are the customers going to go? Is the kind of idea.
01:04:26 Right. Both barbershops could say, expand their waiting room. Both barbershops could hire more barbers or one could say, you know what, if you hire barbers, I'm getting a bigger waiting room. It's like that trade-off. Yeah.
01:04:36 Exactly. A very famous problem in game theory is the prisoner's dilemma. Two criminals are convicted and are separated and are questioned and they can give evidence about the other prisoner. If they both stay quiet, they both give no evidence. The police won't have enough evidence to send them to prison for a very long time. They'll have to stay for a very short amount of time. So that's in their interest. But the police offer me a deal. And if I give evidence about Geraint, then I'll go free and Geraint will go to prison for far longer.
01:05:03 Geraint gets offered the same deal and that immediately creates a dilemma that we will both end up getting for a long time. We will both give evidence one about the other. And so that's a very simple model. And that's actually what I came on the show a long time ago to talk about was that actual model and all the interesting stuff you could do with that.
01:05:19 But this game theoretic chapter is paired with another chapter called agent-based modeling. It's again, one of those points where labeling is interesting because for some agent-based modeling is a subset of game theory. No way it doesn't really matter. And so this chapter is all about emergent behavior. If we can define how decision makers in our system interact, what happens based on what they do, and they being plural, then what is the emergent behavior that you can measure?
01:05:46 The game that we model in this chapter is there are two taxi firms that serve a community, again, a small town, and they get to decide how many taxis they're going to have.
01:06:00 The town wants to incentivize these two taxi firms, essentially not to collude.
01:06:06 They want to incentivize the taxi firms to give better service to the population.
01:06:11 And so we create the game that allows the tax firms to decide how many taxis they're going to have, one, two, or three.
01:06:17 And we build a little model that describes what happens if each tax firm has one taxi, what happens if one has one, the other has two, what happens if one has one, the other has three, et cetera, et cetera.
01:06:29 And then we obtain what is called the Nash equilibrium, which is a measure of if both tax firms know all this and act rationally, what would we expect to happen?
01:06:37 It's just amazing how these outcomes, it's just so clear, you know, if what's the likelihood of the other person doing or the other player participant taking this particular choice.
01:06:50 And if or if I take this choice, what are they most likely to do?
01:06:54 And where are things going to settle in?
01:06:55 It's really neat how this all sets up here.
01:06:58 And let me find the section.
01:07:00 Yeah.
01:07:01 So what you do is you create a NumPy array or that represents one of the participants outcomes and choices.
01:07:10 And this one, I guess it's a what is this a zero sum game?
01:07:14 Because you know, quite not quite.
01:07:15 It's not zero sum.
01:07:16 It's symmetric.
01:07:17 That's symmetric.
01:07:18 OK.
01:07:18 So you pass in the transpose of that, which says here's the other player.
01:07:22 They get basically the opposite of that.
01:07:24 And then you just say Nash.game and off you go, right?
01:07:28 Yeah.
01:07:28 Nash.game creates this game.
01:07:30 It creates the game object.
01:07:31 And in the game object, the Nash.py library has all sorts of different algorithms that could be used.
01:07:35 And the one where we use is something called support enumeration, which is essentially the basic by definition idea.
01:07:42 And the thing that we do do here is we say, OK, if we are the town hall trying to decide how to let these two tax firms compete, is we essentially are deciding not how we regulate them, but how we incentivize them.
01:07:56 So what game should we make the two taxi firms play?
01:07:59 And we do that by essentially say, I guess we will tax you slightly less if you put on this amount of taxis or give you an extra bonus if not.
01:08:08 And the idea is to what is the smallest amount that the city hall has to kind of guarantee to taxi firms to ensure that their rational behavior would be to give that service to the population.
01:08:20 So, yeah, then it's just that those three lines you go on the screen right there.
01:08:23 So while loop where it just increments that offset.
01:08:25 Yeah.
01:08:25 And you just say, get the equilibrium from it and off it goes.
01:08:30 Yeah.
01:08:30 Very nice.
01:08:31 OK.
01:08:31 This is really great.
01:08:32 And I guess it's worth pointing out.
01:08:34 I heard of the guy.
01:08:35 Yeah, that's me.
01:08:36 I should say that.
01:08:37 Work on this project.
01:08:38 So the Nash By Library is myself and former undergraduate.
01:08:43 Actually, they went on to start their PhD at the School of Mathematics.
01:08:46 We started this library.
01:08:48 It's grown quite nicely now.
01:08:49 To be honest, probably the part of the library I'm the most proud of is the documentation.
01:08:54 There's arguably a game theory textbook in there if anyone's interested, as well as all the functionality for two-pack games.
01:08:59 Yeah, fantastic.
01:09:01 Yeah, it looks really great.
01:09:02 I'm a big fan of game theory.
01:09:03 I think it's very simple.
01:09:05 And yet it reveals pretty amazing answers and behaviors.
01:09:09 You know, as opposed to something like partial differential equation, which can also reveal amazing answers.
01:09:14 But the journey to get through it is extremely long versus this.
01:09:18 You could sit down in the afternoon and explain it to somebody, you know, like that prisoner's dilemma and so on.
01:09:24 We could all kind of relate to a lot of what's happening there.
01:09:26 You realize that you're aging.
01:09:27 But I remember when I first started teaching game theory, everyone had seen the movie A Beautiful Mind.
01:09:32 But if people listening and are slightly interested in game theory and haven't seen A Beautiful Mind, I'd definitely recommend it.
01:09:38 It's a Hollywood movie, so have the correct level of expectations.
01:09:42 It's a really nice movie.
01:09:44 Russell Crowe plays John Knapp.
01:09:46 And it's more about, not necessarily about the mathematics, but more about his life, which is incredibly interesting.
01:09:51 And there's a couple of scenes in that movie that arguably, if you just spend a little bit of time talking about a couple of seats in that movie, you can explain most of the game theory.
01:09:59 Absolutely.
01:09:59 All right.
01:10:00 Well, I get the sense we're a tad bit over time, which is fine.
01:10:03 But maybe we should wrap it up here.
01:10:05 There's a bunch of other areas that we haven't covered that are lots of fun that you go into.
01:10:10 So, yeah, very, very neat.
01:10:12 But let's kind of wrap it up.
01:10:14 Maybe we'll ask you the final two questions.
01:10:16 I want to thank you for having us.
01:10:19 But I know that you got these two questions coming.
01:10:21 So, like, oh, do I thank you now?
01:10:22 Do I thank you later?
01:10:23 But no, I just really do appreciate you having us on.
01:10:25 I really do appreciate you as a guest.
01:10:27 Yeah, you're very welcome.
01:10:28 It's been great to talk about it.
01:10:29 All right.
01:10:30 Now, maybe a lightning round.
01:10:32 Vince, if you're going to write some Python code, what editor are you using these days?
01:10:35 I use them.
01:10:36 I use them.
01:10:36 Right on.
01:10:37 Brent?
01:10:37 I use Sublime.
01:10:38 I really like having no features.
01:10:41 I just like typing.
01:10:42 I don't want features.
01:10:43 Right on.
01:10:44 Perfect.
01:10:47 And then a notable PyPI package that you've come across that you're thinking is worth giving a shout out to?
01:10:53 I was thinking about this before.
01:10:54 And the one I'm going to suggest is one called Python Ternary.
01:10:58 You've got it on the screen there.
01:11:00 Yeah.
01:11:00 Python Ternary is a library for plotting on simplexes.
01:11:04 So for plotting on triangles, want a better word.
01:11:08 It's the type of plots you draw a lot in evolutionary game theory, as well as other things.
01:11:12 It's actually a collaborator on a product of mine that maintains this.
01:11:15 And it's a very nice library for plotting different looking plots.
01:11:18 I'm sure people think about, well, you could have these different plots on triangle surfaces or, you know, like how much are you at?
01:11:25 How close are each three different states or something like that?
01:11:28 Yeah.
01:11:28 Some of these are really amazing, like this M Cherry one on there where it's got kind of crawling graphs through these triangle different states and so on.
01:11:36 Yeah, I haven't seen anyone like that before.
01:11:38 It's very cool.
01:11:39 It's very cool.
01:11:40 And it's built on top of Matplotlib.
01:11:41 So it's essentially the layer to do all the correct scaling and things like that is there for you.
01:11:48 So yeah, Python Ternary is really cool.
01:11:50 Yeah.
01:11:50 Fantastic.
01:11:51 Grant?
01:11:51 I think the library I would choose is, it's called Traces.
01:11:54 It's a small library that, I don't know if you've heard of it before.
01:11:58 I've got the link here.
01:11:59 Oh, that one.
01:12:00 Yeah.
01:12:00 It does one thing and one thing good.
01:12:02 It takes moving averages over irregular time intervals.
01:12:06 And it was a problem which I thought I had until I found this.
01:12:10 And then it just made life easier.
01:12:11 I liked it.
01:12:12 Yeah.
01:12:12 Very cool.
01:12:13 Okay.
01:12:13 I think it's the next link.
01:12:14 I think it's one just below that.
01:12:16 This one right here?
01:12:17 Not that one.
01:12:18 This one?
01:12:19 There it is.
01:12:19 There it is.
01:12:20 Yeah.
01:12:20 Yes.
01:12:20 The Uneven Time Series.
01:12:22 Yeah.
01:12:23 Perfect.
01:12:23 Okay.
01:12:23 Yeah.
01:12:23 Oh, yeah.
01:12:24 That looks great.
01:12:25 It does one thing and one thing good.
01:12:26 Fantastic.
01:12:26 All right.
01:12:27 Well, yeah.
01:12:28 And yeah, that's often just what you need.
01:12:30 Put a link to both of those in the show notes.
01:12:33 Thank you so much.
01:12:34 So people are interested in your book or maybe exploring some of these problems.
01:12:39 What do you tell them?
01:12:40 Where do they go?
01:12:40 If you're interested in the book, that's great.
01:12:42 I think I'd more kind of emphasize just mathematics is so incredibly powerful.
01:12:47 And it really, really is.
01:12:49 And it's kind of like I feel that code, open source code, Python, kind of an order of how important each other is.
01:12:57 And so I think I'd encourage people to investigate those things and you can do amazing things with mathematics and a bit of code.
01:13:06 That'd be mine.
01:13:07 I don't know what you think.
01:13:08 Absolutely.
01:13:08 No, no.
01:13:09 Yeah.
01:13:10 I second that.
01:13:11 I think my main message is the maths and the software are separate things and they complement each other really well, but they are separate things.
01:13:21 They are separate things.
01:13:22 Yeah.
01:13:22 That's it.
01:13:23 Fantastic.
01:13:23 All right.
01:13:24 And like I said, your book is on GitHub.
01:13:26 So people can go poke around some of the examples and some of the notebooks and see what we're talking about.
01:13:32 Make it a little more concrete.
01:13:33 Make it a little more applied, maybe.
01:13:35 Yes.
01:13:37 All right, guys.
01:13:38 Thanks for being here.
01:13:39 Thanks for sharing your work.
01:13:41 It's been a lot of fun.
01:13:41 No, thank you so much, Michael.
01:13:43 Thank you.
01:13:43 This has been another episode of Talk Python to Me.
01:13:48 Thank you to our sponsors.
01:13:49 Be sure to check out what they're offering.
01:13:51 It really helps support the show.
01:13:52 Listen to an episode of Compiler, an original podcast from Red Hat.
01:13:57 Compiler unravels industry topics, trends, and things you've always wanted to know about tech through interviews with the people who know it best.
01:14:05 Subscribe today by following talkpython.fm/compiler.
01:14:09 Sign up for the Python at Scale conference to connect with your data science colleagues and learn about trends in the Python big data ecosystem.
01:14:16 Share stories about implementing solutions and find out about innovations in our space.
01:14:22 Visit talkpython.fm/Python dash at dash scale.
01:14:26 That's talkpython.fm/Python at scale.
01:14:29 And use code Talk Python to get 15% off your ticket.
01:14:33 Want to level up your Python?
01:14:35 We have one of the largest catalogs of Python video courses over at Talk Python.
01:14:39 Our content ranges from true beginners to deeply advanced topics like memory and async.
01:14:44 And best of all, there's not a subscription in sight.
01:14:47 Check it out for yourself at training.talkpython.fm.
01:14:50 Be sure to subscribe to the show.
01:14:52 Open your favorite podcast app and search for Python.
01:14:54 We should be right at the top.
01:14:56 You can also find the iTunes feed at /itunes, the Google Play feed at /play, and the direct RSS feed at /rss on talkpython.fm.
01:15:06 We're live streaming most of our recordings these days.
01:15:08 If 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.
01:15:16 This is your host, Michael Kennedy.
01:15:18 Thanks so much for listening.
01:15:19 I really appreciate it.
01:15:21 Now get out there and write some Python code.
01:15:22 I'll see you next time.