Learn Python with Talk Python's 270 hours of courses

#270: Python in supply chains: oil rigs, rockets, and lettuce Transcript

Recorded on Wednesday, Jun 17, 2020.

00:00 On this episode, we're going to weave a thread through three different areas of Python programming

00:04 that at first seem unlikely to have that much in common, yet the core will be the same throughout.

00:09 I think this is a really cool lesson to learn as you get deeper into programming

00:13 and a great story to highlight it. We're going to meet Raveen Kumar, who wrote Python code and

00:19 data science tooling for oil rig tool manufacturers, a rocket company, and a hip

00:24 multi-location restaurant chain. This is Talk Python to Me, episode 270, recorded June 17th, 2020.

00:32 Welcome to Talk Python to Me, a weekly podcast on Python, the language, the libraries, the ecosystem,

00:50 and the personalities. This is your host, Michael Kennedy. Follow me on Twitter, where I'm at,

00:55 mkennedy. Keep up with the show and listen to past episodes at talkpython.fm, and follow the show on

01:00 Twitter via at Talk Python. This episode is brought to you by Sentry and Linode. Please check out what

01:05 they're offering during their segments. It really helps support the show. Raveen, welcome to Talk

01:10 Python to Me. Thanks. Glad to be here. I'm glad to have you here. We're going to take a bit of a tour

01:14 through the manufacturing space, and I think it's going to be a lot of fun. Yeah, I think so as well.

01:20 See how the two connect. I didn't see it at first, but we'll talk about that, I'm sure.

01:23 Yeah, we absolutely will. Yeah, so you've worked with, you know, I think a little bit different than

01:29 a lot of software engineers. You've worked with physical things plus software. Yes, yes. So much

01:36 so that I'd say none of my jobs, the software matter. Nobody bought the software at any of my jobs.

01:40 People bought the physical thing, so. Right. You didn't have like a user funnel or anything like that?

01:45 Not for the software. Software was particularly all internal, so it's just a different dynamic.

01:49 Exactly. Yeah, I spent a lot of time actually building internal software as well, and it's

01:54 actually pretty rewarding and pretty fun, I think. I think so too. Yeah. Now, before we get to that,

01:58 though, let's jump in with your story and your background. How did you get into programming

02:02 in Python? If we go programming, I guess I didn't have much of a choice. My dad was a network engineer

02:07 in the 70s and 80s and 90s, so when I grew up, there were computers all around. In fact,

02:12 there was just a computer when I was a kid, and to get to video games and things like that, I had to

02:16 type stuff into a DOS 3.1 terminal. So my parents always tell me, you see toddlers these days

02:20 like touching buttons on iPads and things like, or no buttons, but touching the screen on iPads and

02:24 getting through it. That was, I guess that was me as a kid. So before I knew what computers were,

02:28 I was using them. And so that just progressed through my teenage years. I wouldn't call that

02:33 programming. I'd say more of it was just scripting, like changing a value here, changing a value there,

02:37 using a terminal and things like that. The programming in Bonafide came at my first job.

02:42 I think that's when I really started diving in.

02:44 Even though you don't call it programming. And for me, I spent my high school years

02:49 and early college, I guess, as well, being a really big fan and fanatic of computers.

02:57 Okay.

02:58 We would do all sorts of stuff on the internet. And back when getting on the internet was

03:02 actually a challenge, you'd have to find a way to dial it to somewhere.

03:06 Yeah. You'd have to, you know, somehow set up Telnet on Windows back then, you know, like

03:13 use like a bunch of weird tools to like piece it together. And I just loved it so much, but I never

03:18 really thought of myself as a programmer, but looking back, developing that comfort with computers,

03:24 just being like quote, good with computers made becoming a programmer much easier because it's,

03:30 it wasn't like, Oh, well, these computers are weird things. It's like, no, no, I love them.

03:34 I just never thought I could really program them, but apparently this is how you do it.

03:37 And it's not so bad.

03:38 Yeah, that's exactly right. It's the same experience I had.

03:41 Yeah. And I think typing in the little games actually takes it to the next level, right?

03:44 But you mentioned floppy disks. I remember having stacks of like 3.25 or 3.5, whatever it was,

03:51 floppy disks, those little hard ones, you know, floppy on the inside with a hard shell, I guess.

03:56 Yeah.

03:57 Just to get one program on, onto the computer. Like I know people nowadays who maybe didn't really

04:02 have to live through those in practical ways, like a game you might want to play. That could

04:06 have been like 20 disks and you'd have to set there and it would say, now put in disk seven of,

04:10 you know, 20. Like, okay, right, right, right, right. Here we go. What a crazy time, huh?

04:15 Yeah. It's so funny. You mentioned that. Cause that's, that was my dad's,

04:17 that was maybe my first programming job is my dad would give me a stack of like the six red hat

04:22 disks, flop floppy disks. Or like if it was 3.1, I think it was like eight or nine. And he'd be like,

04:26 all right, you're just going to sit here. And when it says, push the disk, you're going to push this

04:30 button, grab that out and put the next one in. I would just sit there for like an hour as a kid,

04:34 just watching the screen and watching like the loading bar and everything going. And then he'd

04:38 be like, insert floppy too. And I would put that one in. Then my dad would come check on me. Did

04:41 you do it? Did you not do it? And that's my, maybe my, the first, like the first set of tasks that I

04:46 remember where a supervisor was telling me to, to program this computer.

04:49 Yeah. Yeah. You were, you were working on computers. That's pretty crazy. And now that's like 10

04:53 seconds to download that. Totally different world. It's a fantastic world, but, yeah,

04:58 very different. All right. So this is how you got started in programming. How about Python?

05:03 So Python is probably bifurcated in the same way. I think I remember seeing bits and pieces like Python

05:07 one, even on some of, I used to use Mandrake Linux, which I don't even think is a thing anymore,

05:12 but I had Python on there. But again, it was scripting. It was, I remember it was like something

05:17 to set up at the background or whatever, and Python would set the color. So I went into Python

05:21 script and would change the color. So it went from, from gray to green. What I liked as a teenager,

05:24 green or whatever. Python again, bonafide came in at my first job. And when I was thinking through

05:29 programming languages and I remember like Python, a lot of people say Python's easy reason. I remember

05:34 it was the easiest one to use and read. So I just picked that one and it, it's stuck.

05:39 Yeah. Yeah. I would say you've been definitely doing a lot of stuff with Python after that.

05:44 How about today? What are you doing day to day?

05:46 So day to day, I have maybe two things I do with Python. So I have the, I have the paid job.

05:50 I work at sweetgreen and I use Python to understand how I'll say, I'm going to say

05:55 restaurants work and entrees and salad production goes and we'll get, I'm sure we're going to get in

06:00 all that, but it's a very data science-y focused area of Python. And outside of paid work, I'm a

06:07 contributor to IREs and PyMC, which are two Bayesian libraries written in Python. So outside of work,

06:13 I'm spending a lot of time on GitHub and working with a bunch of these folks, a bunch of folks

06:17 around the globe to make these packages that are widely used by the Bayesian community.

06:21 Right. So give us the high level story of how Bayesian analysis and whatnot factors into Python

06:29 and data science. Like I had Max Klar on for a while. We talked about it in a little more depth,

06:35 but that was a while ago.

06:36 Yeah. So high level, Bayesian maybe seems like a cool new thing, but it's actually super old.

06:41 The guy, Thomas Bayes, he was born in around the 1700s in England. So it's way even before

06:46 computers existed. And he had this particular idea of probability. That's not the one that's taught in,

06:52 at least in American schools. It's where your data is what you know and is fixed and everything else

06:57 about the world is random versus the train of thought that usually goes on as frequentist mentality,

07:02 where your parameters in the model are fixed and your data is random, your dice rolls are random,

07:06 your coin flips are random and things like that.

07:08 The reason it comes into Python is that the formula is very simple. It's just four terms,

07:12 but it turns out it's super hard to solve by hand and you actually can't solve it by hand

07:16 very well for a large class of problems. But if you combine some clever algorithms

07:20 and the Bayes theorem together, you can start doing very, very complex things. So Python has a,

07:26 I'd say, active and robust ecosystem where a lot of people are taking these algorithms,

07:30 implementing in Python and making these nice libraries around them. So normal people like

07:34 yourselves can use Bayes theorem and not have to think about it too much.

07:37 Right. It doesn't feel necessarily like statistics. It feels like a data science,

07:41 a librarian.

07:42 Yeah, exactly. Yeah. Maybe making Bayes theorem data science is the tagline I should use.

07:47 Yeah, yeah, for sure. That's a good way to put it. So tell me if this sort of understanding is

07:52 correct. It feels to me like Bayes analysis is a little bit better at making predictions when you

07:58 can't run and like say the training on a bunch of data that you already have, right? It's like one

08:03 thing to say, well, we've got 60,000 mammograms and we know the outcomes of all of them. So let's

08:08 train up a model on it. It's another to say, we're trying to build a rocket. We've never done that.

08:14 We need to predict how it's going or how it's, you know, make predictions about how like the supply

08:19 chain is working and whatnot. Is that good general rule of thumb or am I off the mark there?

08:23 That's the way that I got into Bayes theorem was as I was getting into Python, I saw these cool

08:27 people doing stuff with neural nets and AB testing and all that. But they're like, oh, you're Google

08:31 and 10 million people have visited your site in the last like one hour. Or you've got this image with a

08:37 ton of information in it and you've got 10,000 of them and they're all labeled. And I was sitting here

08:40 at the time at SpaceX and I was like, I've only got like 30 rocket launches. Like I don't have

08:45 actually the funny way to put this is if you go to scikit-learn, there's a flow chart of machine

08:48 learning workflows. And it's like, if you have less than like a thousand samples, you need to get more

08:52 data. I'm like, what am I going to do? Launch at 900 more rockets? Like I can't AB test rockets. So

08:57 stumble into Bayes theorem. Yeah, that's awesome. And I remember there was this interview, this famous

09:02 interview from Elon Musk after the third rocket failure. Yeah, I think the interview was on the fourth

09:09 rocket launch, the first successful one that they had. He was saying, basically, this was our last chance,

09:15 right? We can't just keep launching these many, many million dollar rockets and failing or just

09:20 having them blow up indefinitely, right? It's not like a government funded thing where we're just

09:26 going to do it until you get it working, right? So you can't take that many shots at it.

09:30 That's true of all manufacturing. So, and I should make the general disclaimer that I'm not representing

09:35 any of the companies that I'm talking about. I happen to work for them and I'm an individual. So

09:38 these are all my experiences and opinions, but that's generally true of all manufacturing is

09:42 we're used to trying in Python or even programming general. You can try things out,

09:46 get an exception and just try it again, like no harm, no foul. But in manufacturing,

09:50 it takes a lot of time and money to make these things. And it's hard to go to your boss and say,

09:53 I actually need to make 10,000 of these randomly to figure out which 100 of them work.

09:57 He or she will just be like, get out. We don't, we don't have the budget for that.

10:01 You can't just make a hundred, salads or whatever wrong just to see whether the customers like

10:05 them or not. That's not a good way to build a physical business.

10:08 Yeah, absolutely. So we're going to touch on some of your experiences in a couple of industries.

10:12 We won't go into anything proprietary at SpaceX or anything like that, but we can talk a little

10:17 bit as like some of the tools and stuff, maybe some of the workflows. But before we do, you know,

10:22 you mentioned that you work on a couple of open source libraries. Do you want to talk about those

10:26 two, each one for a little bit? Just give people a background and how they fit into this whole

10:30 supply chain data science story?

10:32 Yeah, exactly. So I work on, like I said, Pimesee and Arby's. Those are both,

10:36 Bayesian libraries. The Bayesian way of doing statistics and the, and the, the tooling around

10:41 it is fits very well with the type of work that I need to do in ways that like neural networks

10:46 and random force and those don't always. But I mean, in particular too, I want to say the,

10:50 the communities around those libraries, when we talk about Python, not just as a language,

10:54 but as a community was, was extremely nice. So, I just, I find it professionally rewarding.

10:59 I find it, I need it professionally, but then it's also just been rewarding to go in and give

11:03 back to these libraries. I think it's nice people forget, but Python's not a corporation. Like

11:07 it's not like all these people making it, make money or even, even the library. So I'd use Python

11:12 for a while and I felt like, you know what I need, this is the way that I can, I can give back

11:17 and be a part of it more than just using it at work.

11:19 Yeah. I think that's really good. I wish more companies had a more direct belief that they should

11:25 go back and support libraries like this, but it's still really good that, you know,

11:29 companies at least let people like you work on them because I've seen contracts or arrangements

11:34 where it's basically like, I don't know, it, it seems almost like it should be illegal,

11:39 but it's like everything that you think, everything that you imagine, everything that you might touch,

11:46 even if you're not at work, we own that, right? That's us. That's ours. You know,

11:51 if you have an idea for a new product, that's anywhere near where you work conceptually and you have it,

11:56 even if you're not at work, you know what, because you're employed by us, that's our,

12:01 right? That seems just crazy to me, but I've seen stuff like that. And you could see how those kinds

12:05 of arrangements would limit open source contributions.

12:08 Yeah. No, that it was actually a primary consideration in my, my last job search here,

12:12 particularly when I was going to Sweetgreen, the interviews that like the FANG companies that are the

12:15 famous ones, but some of the contracts were worded like that, that any program, anything you do is our

12:19 property. When I had the conversation with my prior boss at Sweetgreen, I don't think people know this,

12:24 but Sweetgreen is becoming a very technology focused company. Actually it is a very technology

12:27 focused company and I was just increasing that way.

12:29 Tell me a little bit about it. Cause I don't, I don't know if Sweetgreen is something I'm aware of,

12:34 or at least it's in the Pacific Northwest.

12:35 Okay. Yeah. So Sweetgreen is a restaurant company is probably what most people see it as.

12:40 The mission of Sweetgreen at a high level is to connect people to real food. So the purpose of

12:44 the company is not necessarily technology. The purpose of the company is to get healthy food

12:49 to people like sort of a, an inaccessible way. And part of that access more and more is,

12:54 is technology. So part of that access is you are easily able to order off an app and get that

12:59 delivered to you at your house. And so it's a very low friction experience. That means that

13:03 you can order healthy food, wherever you're at, not just Domino's or some of the fast food brands,

13:08 but also this is the part that I'm in. It also means that we're making it in an efficient manner.

13:13 Like we're not wasting a lot of food, which I'll talk about in the supply chain stuff later. We're not

13:17 under preparing food. So when you order, you don't have what you want. And that's where the data

13:21 science-y sort of components come in is using the math and the data to make sure that we have the right

13:25 amount of healthy food. So every day when you, Michael want to get whatever you want,

13:29 it's there and it's available and you can get it at your convenience. That's the idea. And technology

13:33 just happens to be a huge enabler in that particular space.

13:37 Yeah. I definitely could see how that, that works. So you were talking about the contracts and some of

13:42 these overly possessive, I don't know, possessive. Yeah, yeah, yeah, exactly. So sweet greens a little

13:50 bit more open to letting you work on things that basically support the business anyway.

13:55 They let me write it. They let me write it as prior arts in my contract and they were accepting

13:58 that. And so I was like, all right, this is a company that seems to really want to give back

14:01 to the community and things like that in their mission. But they, enough so that they let me

14:06 word it in a contract, which is what mattered to me. And I was real thrilled about that.

14:09 I don't get to spend a ton of time developing like per se, like I still have a ton of work to do at

14:12 work, but they were not aggressive about it, which was very, very nice. And I appreciate that.

14:17 And that's why I work at sweet greens.

14:18 I, yeah, I think that's a really cool thing. And more companies should be doing it because ultimately it's

14:24 only going to help them if the tools that you use are better. And if you work on them in your

14:29 spare time, it's not like you're charging them for, you know, that PR that you did on the weekend.

14:35 Yeah.

14:35 They should just see that as a bonus, right? I guess. But yeah, it's, I know where the

14:39 basic idea of, Hey, you can't go create these other things while you work here. I mean, that kind

14:45 of makes sense in some sense. You can't go create a competing company and like incubate it until you're

14:49 ready. But at the same time, you know, it's corporations don't own people.

14:53 No, no.

14:55 They shouldn't anyway, right? So like, but a lot of them kind of treat it a little bit like that,

14:58 which is crazy.

14:58 Yeah. And I would say for the corporations that are listening, like I'm more compelled to work at,

15:02 like, let's say Microsoft or some of these organizations, like particularly Microsoft these

15:05 days, because it seems like they're allowing the developers to work on open source and things like

15:09 that. And that is a huge pro to me as a tech worker to go to a company that supports the

15:15 community and doesn't just take, take the code and hide it away in their private repositories.

15:19 Yeah, absolutely.

15:20 This portion of Talk Python to Me is brought to you by Sentry. How would you like to remove a little

15:27 stress from your life? Do you worry that users may be having difficulties or are encountering errors

15:33 with your app right now? Would you even know it until they send that support email? How much better

15:38 would it be to have the error details immediately sent to you, including the call stack and values of

15:43 local variables as well as the active user stored in the report? With Sentry, this is not only possible,

15:49 it's simple and free. In fact, we use Sentry on all the Talk Python web properties. We've actually

15:55 fixed a bug triggered by our user and had the upgrade ready to roll out as we got the support email.

16:01 That was a great email to write back. We saw your error and have already rolled out the fix.

16:05 Imagine their surprise. Surprise and delight your users today. Create your free account at

16:11 talkpython.fm/sentry and track up to 5,000 errors a month across multiple projects for free.

16:17 And if you use the code talkpython, all one word, it's good for two free months of Sentry's team plan,

16:24 which will give you up to 20 times as many monthly events and some other features. So create that free

16:29 account today.

16:32 So one thing I wanted to do is we're sort of thinking about some of these ideas here. I wanted

16:36 to kind of get your opinion looking back on an episode I recently had. I recently had Jacqueline

16:41 and Emily on to talk about careers in data science, this book that they wrote. And it's a super good

16:46 book, like sort of outlining the different types of companies that you might work at. And I could see

16:51 Sweetgreen being like one of the prototypical types of companies as well as SpaceX and other ones.

16:58 And in there, they said, look, data science is kind of three different areas, you know, three, maybe,

17:05 maybe you could find different distinctions, but they broke it into like different areas. Look,

17:08 there's this, this group of people that does analytics, where they create dashboards and reports to deliver

17:15 data. Or there's people that do machine learning that create models and put them into production. And then there's

17:20 decision science, which basically helps make product recommendations like Netflix and whatnot. And it sort

17:27 of sounds like you've been a little bit in the analytics side of things, at least with that

17:33 categorization.

17:33 So I would say my career has progressed through these. I did analytics at the start because it's the

17:38 easiest one and the most obvious one. I tried at the companies I was at, I tried using machine

17:45 learning in an NOV, which is my first company and SpaceX, but didn't wasn't really good fit there.

17:51 What the constant threat has been has been decision science for me, particularly the thing I do the

17:55 most now is use programming data to help somebody make a decision. It could be a person in the

18:00 restaurant. It could be an executive. It could be someone at my level, but how do I take all the

18:06 information we have and package it in a way that helps that one person make a more informed decision

18:10 about whether to buy, whether or not to buy, whether to do this, whether to do that.

18:14 Yeah. And I guess also one of the main themes is sort of the supply chain side of things, right?

18:19 So let's maybe just set the stage of the three different places where you went through some of

18:24 these experiences, right? So you started out in heavy manufacturing where you were working

18:29 at a company that built tools for oil and gas exploration or something like that, right?

18:34 Yeah. Yep. That's exactly right.

18:36 Okay. And then this little company in LA called SpaceX.

18:39 Yeah. I don't know if a lot of people have heard of it. It hasn't been on the news, but yeah.

18:43 It's a rocket company.

18:44 Fourth of July all the time. Pretty awesome. And then Sweetgreen now.

18:48 Yeah.

18:48 So maybe give us a sense of the types of stuff that you did at each of those companies,

18:54 just like the high level stuff.

18:56 And I think it follows like my career progression and sort of what the framework that you laid out

19:00 earlier. So first job was NOV. And that's of course, when I was the most junior with Python,

19:03 that was largely just analytics. How many parts have we made yesterday? How many parts did we make

19:08 today? What parts did we not make yesterday that we needed to make today? I'd say this was the nexus

19:13 of my programming. The company NOV is like a fortune 100 large company. It's been around for 150 years.

19:19 So people are used to doing things the way they've been doing them for a long time. So

19:22 I was in charge of this manufacturing operation and you would have the list of 20 things you needed to

19:27 make yesterday from the Oracle system. You would have the list of 20 things that you need to make

19:32 today. And some of those would be the same and some of those wouldn't. And what would happen is that

19:36 person would print out, would have yesterday's list from yesterday. They would print out today's list.

19:40 And with a highlighter, they would put them down on a table and highlight the ones that they finished and

19:44 the ones that they didn't finish. And that's the way they would build their reporting to say,

19:48 here's what I completed. Here's what I didn't complete. And I was looking at those like, no way.

19:52 You can do this with, you have to do this with programming. Like you're spending 10 minutes on

19:57 this a day. My job is to make you more efficient. And there's 20 or 30 people doing this across the

20:01 company every day. Like let's just write a Python program that just imports this, does a set subtraction

20:07 and from yesterday to today. And that's where you go. And that was the first application that I had

20:12 was programming can be used in this context to just make things so much more efficient,

20:16 less error prone, and just get these, help these folks do the thing that matters,

20:20 which is build parts and not sit there with a highlighter all day.

20:23 Right. And that's not a super deep programming challenge per se, right? I mean, set and set

20:29 subtractions even built into Python, right? Yeah.

20:32 But at the same time, having that automated, having that real-time visibility, having it,

20:39 you know, be sure that you're not missing something. That's great.

20:41 Yeah. It's huge. And I'd say, even if you don't listen to the rest of this podcast or any other

20:46 episode of Talk Python, like there is a huge amount of work that you can just do with the Python that's

20:51 pre-installed on your computer and the standard library, like import CSV. And there's a ton of

20:57 work that can be done and a ton of utility can be added just with that. I think Scott Hanselman had

21:01 this blog post that I really like called Dark Matter. He has this thing called Dark Matter

21:05 Developers. It's a type of thing, like there's so much of this work that's just out there and people

21:09 are thinking about neural nets and Bayesian and, and, pytest and all these like,

21:13 not big things, but like all these tools and stuff you can use.

21:16 Computer science-y, like sort of advanced developer tools and companies and infrastructure and whatnot,

21:21 right?

21:22 Exactly. Yeah. And you can just do so much just by typing Python in your terminal and getting the

21:27 standard library and just going like, don't feel like you have to jump into everything all at once.

21:30 Like there is a ton of opportunity just at that level. And I call it like Python scripting almost,

21:35 maybe not even programming just a single Python file.

21:38 Right. It might not even have a function.

21:39 Yeah. Doesn't even need to have a function. This one didn't have a function. It was import CSV,

21:43 got the CSV and says distraction and print to a terminal. And that was it.

21:46 That is super cool. I do think that there are so many of these scenarios or low hanging fruit of,

21:53 you know, this thing, I do it all the time. It's error prone. It's slow. And if I didn't have to do it,

22:01 life would be better or if it would just automatically happen. And I've actually seen some of those things

22:06 in my business around, say, running the online courses and stuff, there were some things where it was

22:11 so painful. I'm like, you know, this takes me two to three hours to get a course ready to just

22:16 go through and find like, how long is each video? Right. And put it into the database.

22:20 Yeah.

22:21 All these things. And, you know, I was thinking, well, should I like find a contractor, somebody who would

22:26 go through and do all these things? And then like, what is wrong with me? Why don't I just

22:29 both try to write a program? And now all of these types of things, they take seconds, maybe,

22:35 and it's automatic and it never makes an error. And it really was, you know, like you said, 10 to 20

22:41 lines of code. And so there's things, even if you're a programmer, sometimes you just don't think like

22:46 that actually, I could automate that. And then it would be without error and it would be instant,

22:52 basically. And so there's a ton of low hanging fruit, but especially if you're getting into programming,

22:57 I think there's a lot of options for those.

22:58 Yeah. And I would say this is where I got hooked on Python, because when you start with Java, for

23:02 example, the first thing you hit with is like his main thing. And so I think Brett said this in one

23:06 of the podcasts, Python fits the human brain. Why my human brain at the time was particularly

23:11 manufacturing. Like what the hell is, what is main? Like, I don't, why am I even dealing with this?

23:14 Whereas with Python, I could jump straight into, okay, I've got this list and I've got this list and I can

23:18 subtract them. And it fit my way of thinking. And I've just found that Python has just been like that.

23:23 That's like just enough when you need it. And that was really the ramp into that particular

23:27 language and why I've been in it so long.

23:30 Well, you look at the growth of Python and I think the reason, you know, people compare different

23:35 languages like, well, Java, it's statically typed and has these interfaces and it does this. And

23:40 Python is like this, it's, you know, dynamically typed, but it can have optional type and you could

23:44 treat it. Right. I think you can get over, you think people can overanalyze that. I think

23:49 a large reason why Python is so popular is that story you just told repeats thousands of times a

23:56 day. And, you know, you were like, this is not that complicated. I just need to do this simple

24:02 thing. It's going to let me do this thing, but I'll bet you the stuff you write now is way more involved,

24:07 right? Like it's slowly pulled you in and it didn't make you learn all the computer science things like

24:12 interfaces and compilers and linkers and classes just to do that thing. But probably at some point,

24:18 you're like, Oh, we probably need a function so I can vary this, or maybe I want to use this other

24:22 places. So let's make it a package. And like, it slowly drags you in deeper and deeper. And I feel

24:28 like so many people get started, not even thinking of I'm a developer. They get started as I didn't need

24:33 to do computing. And like, once you're pulled into Python, then you're kind of in its gravitational

24:38 field or whatever. Yeah. Mine was, I'm just tired of doing this stuff in Excel. So how can I do this

24:43 outside of Excel? And Python was like that next, next step.

24:47 So you talked about the automate the boring stuff a little bit. We get back into that some more,

24:50 but setting the high level, SpaceX, what kind of things were you doing there in the supply chain?

24:55 Yeah. So NOV, my job was to just deal with one manufacturing area. It's this part goes in,

25:00 this part goes out. When I got to SpaceX and progressing Python more, my job was now to think

25:05 about the entire supply chain. I don't think about one part anymore. My job is to think about every part

25:10 that goes on to, in this case, the rocket, and figure out when they need to get to the right place at the

25:14 right time. So my thinking went from a small area to a very, very wide, wide area. And where that,

25:21 where Python came to fit with me on that one is it wasn't just set subtraction anymore. Now I needed to,

25:26 I had to think at a higher level. So think about when you guys see a rocket on one of the,

25:30 the live streams at SpaceX or whatever, you guys see one rocket, but the way I see a rocket

25:34 at a big level is I'm just going to go through this real quick. There's with the last dragon launch,

25:38 there's the dragon capsule to make a dragon capsule. You need a trunk and sorry, to make the whole

25:42 dragon. You need it to trunk in the capsule. That's just the top. Then the second stage is

25:46 that middle piece and you need an engine and you need that second stage tank. And then for the

25:51 booster, the bottom part that's got grid fins, there's four of them, there's legs, there's,

25:55 there's multiple stages. And so suddenly this one rocket starts turning into like a hundred pieces.

26:00 The pieces are huge. The smallest piece that I had to plan with my software was the size of a

26:04 refrigerator. And then the rocket gets to 15 stories from that. So how do I take not only this one

26:10 rocket, but every single rocket that SpaceX is building and help someone play what I like to

26:15 call rocket Tetris, both in time and in space that like this piece, this humongous piece is going to

26:20 be here. So we need to move that, this humongous piece here. Then we have the space to move this

26:24 other piece here and over somewhere else. We're moving in all these other things and like link

26:28 together all of these, this basic enormous rocket that has to come together. And my job there.

26:34 I'm sorry. That was, it sounds like an amazing optimization problem because you've got this huge

26:38 factory, but the rocket pieces have to be assembled in different areas, but also you've got to have

26:43 the individual parts arrive on time. You've got to have enough of them, but you can't just go buy

26:48 like three extra engines. Yeah. Right. Yeah. They take a while to make. Turns out it takes, it takes a bit

26:53 of time to make a rocket. So you've got to think ahead. Yeah. Yeah. It was, and this is an

26:58 interesting one because, and this is, I should mention this Python wasn't doing any optimization,

27:01 but what Python would do is I built this tool that one of my friends there now, you can put in all

27:06 these inputs and it comes up with what, what the linkages of, of what's called the, I'm

27:11 not wording this. Like I'll use the programming term, but the dependencies, the graph of, the graph

27:15 of dependencies, when certain things would happen, if you have certain lead times and certain,

27:18 certain constraints and whatever. So he would run the program. He would see that with this particular

27:23 set of inputs, with this lead time and this assembly and this, and this, we're not scheduled to have

27:27 a rocket launch until like February or something like that. And he goes, Oh, that's not going to work.

27:31 We need to get it earlier or we need, or whatever. And so he would then change some inputs because he

27:36 has the human knowledge, put that into the calculator. The calculator would then do the same graph

27:41 explosion and time explosion. And he would get a new set, new set of outputs and be like, okay,

27:45 I can work with this. I can't work with this. So it was him working back and forth with the program

27:49 to run through the scenarios. And then once he had the scenarios that fit the objectives, he would then

27:54 bring it up to, to the managers and things like that. So the program, he was like the human optimizer,

27:59 but he would use the program to quickly lay out the Tetris board of what things would look like.

28:03 Right. Right. Well, I'd say maybe you identify that there's something unexpected that actually

28:07 seriously delays the production, right? Like, Oh, there's a specialized hose that takes, you know,

28:12 liquid, whatever, right over here. And it actually, that's the thing that takes so long to get or to,

28:18 it's the one thing that holds up a big part of the construction. And so let's make sure there's no

28:22 delays on that.

28:23 Yeah, exactly. You would see, that's called the critical path in manufacturing. It's what is,

28:26 what is going to take you the longest time and delay the whole project. You're always trying

28:30 to keep an eye out for those types of things. If we go back to the code itself, I think we had

28:35 talked about the earlier example, it was just sets and I was like, good to go. Just the built-in types.

28:39 But now I, there's no built-in types for rocket. So Python grew up with me, or I grew into Python.

28:44 And like, now I could define an object that was like, here's this booster object. Here's the

28:48 interstage object. Here are the attributes associated with it. And I could start like,

28:52 again, like what Brett Cannon said, I could start writing Python. I could start writing a layer of

28:56 abstraction on Python itself that fit my rocket brain and the way I think about rockets and the

29:00 way we thought about rockets and just using objects, classes, methods, modules, and like that next layer

29:06 of Python. At this point too, it's, this is all deterministic planning. You know, what's going to

29:11 happen precisely, or you at least assume, you know, what's going to happen precisely. So with the

29:14 earlier example, you knew which was, what was completed and what you needed to do.

29:18 Deterministic. At SpaceX as well, the software I had built was deterministic. You just say that

29:22 it's going to take 10 days and that's the assumption you're rolling with, or it's going to take 15 days

29:25 and that's the assumption you're rolling with.

29:27 Yeah. Yeah. Very cool. And you know, maybe just stepping back for a second, like,

29:32 what do you think about what SpaceX has been able to accomplish?

29:35 I mean, I think it's amazing. I am super happy and super fortunate to have been

29:38 an employee of the company and been there with the time I've had. So one of the best experiences of my

29:43 life for sure. And I think if we go into space a little bit, I think everyone listening to this

29:47 podcast should know that within the next decade, you could be an astronaut. Like the goal of the

29:51 company is to make you an astronaut where you could go into space yourself, either for maybe

29:56 either sort of made these moon missions that the one that this one Japanese person has bought. But

30:01 the point of the company is to get to Mars, like get a million of us to Mars. And so it's super

30:06 inspiring to think about. There's a group of people that you can, that most people here could be a part

30:10 of that can, you can contribute to that mission and get yourself there.

30:14 I mean, it's such a wild thought to think, I don't know how many people have gone into space,

30:16 but it's got to be in the hundreds, you know, historically speaking. Right. And to think,

30:21 you know, that's just, we're going to double it. It's just one flight.

30:26 This portion of Talk Python to Me is brought to you by Linode. Whether you're working on a personal

30:31 project or managing your enterprise's infrastructure, Linode has the pricing, support and scale that you

30:36 need to take your project to the next level. With 11 data centers worldwide, including their newest

30:41 data center in Sydney, Australia, enterprise grade hardware, S3 compatible storage, and the next

30:48 generation network, Linode delivers the performance that you expect at a price that you don't.

30:53 Get started on Linode today with a $20 credit and you get access to native SSD storage, a 40 gigabit

30:59 network, industry leading processors, their revamped cloud manager at cloud.linode.com,

31:04 root access to your server, along with their newest API and a Python CLI. Just visit talkpython.fm

31:11 slash Linode when creating a new Linode account, and you'll automatically get $20 credit for your next

31:17 project. Oh, and one last thing they're hiring. Go to linode.com slash careers to find out more.

31:22 Let them know that we sent you.

31:23 I think the real magic to me of what SpaceX has been able to do, one, it's kind of interesting to

31:31 see a private company just come along and do that. But the real magic to me has been the reuse and the

31:38 landing, right? Not the, we're going to take this thing and just throw it away every time.

31:42 But it becomes, you know, not something that's destroyed, but something more like a 747.

31:47 Yeah, well, think of it like a programming coma. Every time you run your program, it just deletes itself. How many programs would you write?

31:54 All your Python programs were self-destructing. It'd be a lot harder to get this stuff done. And I guess while we're on the rocket industry in general, like I come from the supply chain, but Python is used extensively throughout the entire rocket industry. Like it's used to calculate trajectories of rockets. It's used to calculate the mass of rockets, which is particularly important because you got to get it in a space. It's used in so many contexts across so many disciplines in the rocketry industry across so many companies that I think all the core developers of Python should be pretty, pretty proud. I don't know if Guido was thinking that his ABC programming language would be used to make rockets.

32:11 It's kind of a far stretch, but it's happening every day.

32:28 Yeah, that's really awesome. Yeah, I think Python is being used for a lot of things that nobody predicted it would be used for.

32:35 Yeah, definitely.

32:37 It's a good fit. I'm not saying it's not a good fit necessarily.

32:40 It's just like...

32:40 It's a great fit.

32:41 I think actually, historically, one of the challenges of going from Python 2 to Python 3 that the core developers, and Guido said this himself a little bit when I talked to him quite a while ago on, I think it was episode 100 even, probably.

32:56 Anyway, one of those shows I had him on quite a while back said something like, one of the big challenges was we underestimated how foundational Python and its libraries were for so many people.

33:09 They thought, oh, well, we'll make this change to Python 2, upgrade it, and people will just adapt and didn't realize like whole banking systems are built on top of the details of this light or these, all these are super important libraries that actually support so many different things, depended on the exact details.

33:25 And making these relatively minor changes was a lot harder because of those sort of dependencies.

33:30 Yeah, I'd say you're the victim of their own success there, right?

33:33 Yeah, exactly.

33:34 Exactly.

33:35 So I think a lot of people don't really have that much of a visibility to the true scope of how much is built with Python and how much depends upon these libraries that people have created.

33:44 I would agree.

33:45 Yeah, absolutely.

33:46 Yeah, I found an interesting place.

33:48 I don't know if you've heard of it called the Open Source Aerospace Computing.

33:52 Okay.

33:53 And it's for simulated rockets.

33:54 It's got a bunch of different Python modules to do so, like six or seven different things for like simulating high power rockets and different stuff.

34:02 I'll put that into the show notes.

34:03 People can, you know, it's, that sounds really fun.

34:05 That is fun.

34:06 I'm going to take a look.

34:07 That's awesome.

34:07 I didn't realize that.

34:08 See, I'm learning stuff right now about Python and in the aerospace industry and on this podcast.

34:13 Exactly.

34:15 All right.

34:16 So over there, you had these complex but deterministic calculations.

34:21 Yeah.

34:22 And it was SpaceX and they're doing super, super cool stuff.

34:25 I looked over on SpaceX.

34:27 I think this is a few months ago.

34:29 The last time I looked though, they had 92 different job openings for Python.

34:33 Yeah.

34:34 That speaks to itself.

34:35 How much that language is used.

34:37 Yeah, absolutely.

34:38 There wasn't a lot of visibility into exactly what was happening there, but that's not 92 positions.

34:43 That's 92 different roles they're trying to fill, which might be more than one person for each one.

34:48 So pretty, pretty interesting.

34:49 And then now you're working more in the forecasting world with Sweetgreen, right?

34:55 So I would say in this, I still do all the level one stuff that I do.

34:59 Maybe the set instruction.

35:00 I think of it more like a pyramid.

35:02 I still do a lot of that.

35:04 I think when people talk about data science, you get this idea that like, oh, everyone's out there doing amazing data science.

35:08 I don't know if your panel mentioned this at all, but most data scientists spend a lot of time cleaning data and automating the boring stuff.

35:13 It's surprisingly little amount of time is spent, you would guess, in the cool math portion of it.

35:19 So it's more like a pyramid for me.

35:20 I still have a huge wide base of like automate the boring stuff because that's super important and easiest way to get value.

35:26 I still have a middle layer that's there of deterministic type of calculations.

35:30 And now through self-learning and through the help of the Beijing community, particularly the Pimesky and Arby's guys who've been so nice to train me up over time.

35:38 And let me join.

35:39 I'm doing some amount of data science-y tasks.

35:42 Some of that's forecasting.

35:43 Some of that we do is optimization.

35:46 It's across the board.

35:47 But it's really, again, the point isn't whatever way we can use data to help connect people to real food is we're going to do that.

35:53 If it's automate the boring stuff, we're doing that.

35:55 If it's a forecasting model, then we're going to figure out how to do that.

35:57 But the idea is, how can we use programming and technology to fulfill this physical mission?

36:02 It almost seems like the food story would be harder than the space story, which, sorry, a bit of a cough today.

36:11 So it sounds a little contrary, right?

36:14 Like space and space science seems so hard, but food spoils, right?

36:19 Like if it's five days instead of three days, maybe you can't eat that, right?

36:23 Yeah.

36:23 So this is, if we ignore the space or food part of it, if we just talk supply chain for a second, which interesting enough is I don't have any degree in programming.

36:31 All my degrees are mechanical and supply chain.

36:33 SpaceX, the demand was relatively certain because you don't have that many rocket launches.

36:38 There's a lot of nuances and stuff like that, but there's only so many customers.

36:40 At Sweetgreen, there's like tens of thousands of people that could come into any of the locations on any day.

36:46 So it becomes a much more challenging problem to figure out which salads people are going to want or which ingredients people are going to want when they walk into any speaking location across the nation.

36:57 So, and to your point, you can't just prep everything because it'll spoil and it'll all go bad.

37:02 And then you're not connecting people to real food.

37:03 You're just wasting food, which is the absolute opposite of what we want.

37:07 So how do you just get the right amount of everything?

37:10 And that is very, it's very non-deterministic.

37:12 I'll tell you that.

37:13 People, people's salad preferences are not deterministic.

37:16 I can't, I can't predict what you, what someone would want on any given day.

37:20 Yeah.

37:20 Or when there's going to be some event that you didn't realize, right?

37:24 Like WWDC happens to be right near one of the restaurants or something like that.

37:28 Mm-hmm.

37:29 Yeah.

37:29 Interesting.

37:30 So what are some of the tools you're using over there to make these estimations?

37:35 Yeah.

37:35 So this is a lot where when we talk about Bayesian stuff, this is, and not that everything we do there is Bayesian, but like the Bayesian scope of data science lets me work with smaller data sets and more uncertainty.

37:46 So it lets me, it lets us figure out with uncertainty bounds, how much of a particular thing might be used on a day.

37:52 Like that's an example of a type of problem that I could solve at Sweetgreen.

37:56 There's actually in supply chain, there's this idea, this model called this, the single period model or the salvageable model.

38:01 What it is, is the classical example from, from actually 1888 is you're a news vendor, like you're a news girl, a news boy, and you can buy so many newspapers in the morning.

38:10 You can buy 10, you can buy 15, you can buy 20, but by the end of the day, you have to sell them all because if you don't sell them, they're trash.

38:16 No one's going to buy a day-old newspaper.

38:17 So given that-

38:19 Oh, did you read that one newspaper with the headline?

38:21 You should really get that one from three years ago.

38:23 It was super good.

38:24 No, that doesn't happen.

38:25 Turns out, yeah, it doesn't happen very much.

38:27 So how do you decide how many newspapers to buy?

38:29 Because they cost you money.

38:30 Maybe they cost you 25 cents to buy and you can sell them for 75 cents.

38:34 What's the optimal amount to buy?

38:35 And traditionally, the way this problem is solved is like, oh, well, you just sell, you just have 10,000 days of demand.

38:40 And you just take the average and that's how many newspapers you buy.

38:43 But now you spend 10,000 days making suboptimal or inoptimal decisions.

38:47 So what Bayesian stats lets me do is like, well, if I have five days of newspaper demand, okay, even though it's not a lot of data, I can say that with 17, 20, 21, and 22 and 25 sales, I should maybe buy 20.

38:59 But the uncertainty bounds are there could be 16 sales, there could be 28 sales, and I can make a decision of what to do there.

39:04 And as you get more and more data, if there's certainty in your demand, that distribution will shrink over time.

39:09 And that's the real trick for me with Bayesian type of analysis is I can work with small data sets.

39:16 I preserve uncertainty, which is critical in business decision making, right?

39:19 I don't want to go in there and say the mean is going to happen and the mean doesn't happen because the mean is never going to happen, almost ever, never happens.

39:24 So I want to go in there and say it'll be somewhere between this and this value.

39:27 And the part that we haven't talked about is that Bayesian stats in particular, you build a very nuanced model to capture what you know in your head.

39:35 So random force and neural nets, there's very little you can do besides just tuning some hyperparameters.

39:40 The algorithm is relatively fixed.

39:42 But with Bayesian models, you can say I'm a news vendor and I have demand for New York and demand for Boston.

39:47 And I know which day of the week it is.

39:49 And I know that on event days, we might sell more newspapers.

39:51 And you can build this graph, which is the probabilistic programming language part of it, of probabilities that helps you get a more, I'll say precise estimate, even though that's not the right statistical term, but helps you build a more nuanced model that gets you to a better estimate.

40:06 And that's the real power in it for me is the uncertainty and the ability to encode human dependencies into the programming language.

40:15 In this case, into PyMC3, for example.

40:17 Right, right.

40:18 Well, and preserving that uncertainty and communicating that is super important, right?

40:22 Because it's one thing to say, we think we're going to meet this deadline or sell this many salads or sell this many cars.

40:32 And you go to plan around it, if that's, well, here's the number and there's a small variation.

40:37 Yes.

40:38 Here's the number, there's a huge variation.

40:39 Like, you want to approach that from an investment perspective, super different.

40:43 Exactly.

40:44 That is the key portion.

40:45 That's the thing that like standard linear regression does not get me.

40:47 It gets me the mean, but it doesn't tell me how far off I might be.

40:50 Yeah.

40:50 Yeah, for sure.

40:51 So it sounds to me like you've been doing a lot of research into this whole Bayesian side of things.

40:58 Maybe even book level research?

41:00 Yeah.

41:01 So I've kind of just fell into the pool of Bayesian research.

41:04 The open source story is I saw PyMC and RVs and I figured, hey, why don't I just open a pull request for like two typos?

41:10 And Chris Fonsbeck was so nice to merge it immediately.

41:13 I was like, this feels great.

41:14 This is awesome.

41:15 I'm just contributing to open source.

41:17 And then they just kept going more and more.

41:18 And they started letting me contribute more and more code.

41:21 And I've just been talking to those guys.

41:23 And over the two years, me and a couple of the other guys who work on PyStan, RVs and PyMC3.

41:29 So all of these are Python Bayesian libraries.

41:31 We're like, you know what?

41:32 We think we can write a book that explains how to use Python to use Bayes theorem with a much more modern twist on it.

41:39 So you've got a lot of Bayes theorem books from like the 80s or the 90s and things like that.

41:45 You've got a couple of introductory books.

41:46 So Osvaldo Martin.

41:47 And those original ones have to be like super theoretical, right?

41:50 So it's interesting.

41:51 They're theoretical prior to the 90s because there were not very many algorithms to solve Bayes theorem at the time.

41:57 You were constrained to what were called conjugate models that you could solve by hand.

42:00 I don't know if you talked about this in the other podcast, but this algorithm called MCMC sort of hit the streets in the late early 90s.

42:06 It was a just bust the door down on computational Bayes theorem.

42:09 Like turns out this particular algorithm, if you use it in particular ways, just works really well.

42:14 And since then, people have just been making it better and better and better.

42:17 And so there's actually different variations of this now called like Hamiltonian myocardial.

42:21 And within that, there's a subset called the no U-turn sampler that just do great on solving, not solving, but doing Bayesian inference.

42:28 But there's not a lot of a, we think there's a gap where we can write this book to help people understand how to use it in a more, more advanced ways.

42:37 So for reference, Advaldo Martin wrote this book called Bayesian analysis and Python.

42:41 He's actually one of the co-authors on this other book.

42:43 It's an introduction to how to use Bayes theorem in Python.

42:46 And so if you don't know anything about Bayes theorem, I would just say, go buy this book and you can start learning Python and start learning Bayes theorem sort of in the same book.

42:54 But it's an introductory level.

42:55 So he only goes so far.

42:56 There's more layers to Bayes theorem.

42:58 Things like Gaussian processes, Bayesian regression trees, decision analysis that we're covering specifically in this intermediate level book that we're hoping to publish by February.

43:08 Awesome.

43:08 Yeah.

43:09 So you have a new book that you've co-authored, Bayesian modeling and computation and Python.

43:13 And I got a, just a super brief look at it.

43:16 It looks pretty interesting.

43:17 It looks like it's pretty approachable.

43:20 It's got a lot of nice graphs and pictures and a little bit of theory, but then here's the library call that you make to do that thing.

43:27 And so it looks like it has this really nice practical aspect to it.

43:32 So yeah, I hope the, hopefully the book takes off and does really well because it looks useful.

43:35 Thanks.

43:36 Yeah.

43:37 Yeah.

43:37 I will put a link to something, whatever you think is the right thing to link to in the show notes so people can sign up to get notified or whatever.

43:45 Okay.

43:46 Yeah.

43:46 I'll come up with something.

43:47 Yeah.

43:47 Perfect.

43:48 So one of the things I think that was interesting, I want to kind of dive into a little bit with you here is a lot of the things that you talked about were pretty straightforward, at least in the early days.

44:01 You talked about automating, you talked about automating, like basically comparing CSVs and getting a nice output and whatnot.

44:08 Yeah.

44:09 And so much of the talk out there is, you know, here's the cool architecture of what Google is doing, or here's how Instagram upgraded their huge Django production from Django 1 to 2 and Python 2 to 3.

44:25 Yeah.

44:25 Yeah.

44:25 And so on.

44:26 And people focus on that and I think they get excited about it.

44:30 But at the same time, so many people can just solve these little problems for themselves, right?

44:34 With, and really, it doesn't have to be these huge engineering efforts to get a lot of value out of it, right?

44:39 Yeah, I agree.

44:40 Yeah.

44:41 I think there's just a lot of opportunities for people who are non-programmers to sort of level up what they're doing with a little bit of Python.

44:47 So, yeah, it sounds like your story, the arc of your story tells that as well.

44:51 I tend to think, I think, yeah, you're right.

44:53 There's a lot of publicity and press around the big things, huge installations, like the massive side sorts of stuff.

44:59 I think of it like cooking or whatever.

45:00 You see like the chef's table on Netflix and it's like all the people that are like the best and whatnot.

45:04 That's what you see a lot in blog posts and articles and on Hacker News and whatnot.

45:08 But there's a whole class of people like me that are like making mac and cheese on a stove and we're just fine.

45:14 Like the stove's the same.

45:16 But it's good mac and cheese.

45:17 But it's good mac and cheese, yeah.

45:17 You get better over time, yeah.

45:19 So you don't, I would say, I hope people don't get intimidated when they start seeing terms like, and I use pytest all the time now, but they don't.

45:24 They see Docker, pytest, Packaging, PyPI, like all these acronyms and stuff that are now prevalent for good reason, but they're now prevalent.

45:32 I hope they realize that, you know, you can just fire up a Google Colab these days and just get your basic thing done.

45:38 And that, like, you are an A-OK programmer.

45:40 Like, that is awesome.

45:41 You're creating value.

45:42 And that's what matters.

45:43 Not that you have a multi-cluster Kubernetes thing at the edge with instant retry fails or, you know, all these terms that get thrown out, like, these days.

45:52 Yeah.

45:53 And the whole reason I bring it up is I feel like there's a lot of people who are newer to the programming space.

45:58 They see these big, impressive stories of technology and whatnot, and they feel like, well, what I'm doing isn't good enough.

46:06 How do I go learn Kubernetes so that I can also do it the right way?

46:10 And, well, the right way is very different.

46:14 We were talking about racing before we hit record.

46:16 Yeah.

46:16 If you're in F1 and you have an insanely competitive environment, like, what you're going to need to do to make the brakes work is very different than if your minivan is going to go on a road trip, right?

46:29 Like, you would never go and do what they do in F1 to your minivan because it just doesn't make any sense.

46:35 And so, like, I think I just want to encourage people to just a lot of time, not everyone, but a lot of folks to remember they're not Google, they're not Facebook, they're not LinkedIn.

46:43 And so these simple solutions are not necessarily just a compromise that they can make.

46:49 They might be actually the better solution than what some of these fancy tech companies are doing for their situation.

46:53 I actually want to word that even stronger is the right way is what works for you to do the thing you need to do.

46:58 And the thing that Google is doing most likely is the wrong way for you.

47:02 Because if you're not at Google, like, terabyte scale, like, doing what they do for your Excel file is not what you need.

47:08 Like, if you're running Hadoop on your Excel file, definitely the wrong way.

47:11 Don't fire a PySpark to analyze your Excel file.

47:14 Like, there's a right way.

47:15 10,000 entries or whatever, yeah.

47:17 Yeah, exactly.

47:18 So don't always take what Google and Instagram and everyone are doing as the right way for your situation.

47:23 Definitely inspiration for what the language can be and that there's really no, in my opinion, no barriers on what Python can do.

47:28 But I would say don't get intimidated.

47:30 Like, look around, see what's around you that's automatable or boring or that you just find tedious.

47:36 And just start with that.

47:38 And if all you do is make that script, then that's a Python success story in and of itself.

47:42 And you should be proud of that.

47:43 Absolutely.

47:43 Absolutely.

47:44 Now, another thing that I want to talk about really quickly before we wrap this up.

47:48 I've had this experience and I know that to some degree you have as well.

47:53 It sounds like those three environments are super different.

47:56 It sounds like helping people work with predicting or understanding what tools they've made in their supply chain and what ones they still got to produce.

48:06 Going to working with predicting rocket construction, going to predicting salads.

48:11 Like, it sounds like as a preparation or as a set of skills you need to learn to go work with rockets versus salad.

48:18 It seems like that's really, really different.

48:21 Right?

48:22 But in practice, I would bet that the actual coding and the tools are not as different as it would sound.

48:28 Yeah, I think there's just a lot of commonality.

48:31 And so this is another inspiration I want people to take is that the things that tech companies do, you can absolutely bring those into your business.

48:39 Like, almost every, I want to go as far as to say almost every business at this point could use Python.

48:45 So don't feel like just because you're not working at Google, Facebook, or one of those large companies that you can't find a use for programming at your job.

48:51 And that's the experience that I found.

48:53 NOV is an example.

48:54 That company's been around again for 150 years.

48:56 So they've been building stuff way before computers were even a thing, at least electronic computers.

49:00 And definitely before Python was around.

49:02 But still at that company, there was an opportunity to use Python to make that company that much more efficient in certain ways.

49:09 And that same skill set then translated to what people think is the more high tech company, which is SpaceX.

49:13 Like, the same basic idea of taking data, processing it away, and then placing it in front of users in a way that they can think about it was relevant at SpaceX.

49:22 And to be frank, after SpaceX, I didn't realize that it would be useful in the restaurant industry.

49:26 But after a couple interviews, I realized, holy crap, it's the same ideas, the same tools, the things that I've been working on are things that this company is already doing.

49:35 The manager that I now work for had already been using Python for two years to do a very similar sort of stuff.

49:39 So even for me, I had to make that mentally, but hey, the stuff that the Python that I use in manufacturing companies is the same style and thinking that I can use at a restaurant company.

49:49 And it's equally valid.

49:50 And it works out super well.

49:52 So I could just like, quote unquote, import my knowledge of environments and JupyterLab and Bay Serum and all the things that I picked up along the way to use at Sweetgreen.

50:00 It's so interesting because it, you know, looking in from the outside, it seems like it would be absolutely not the case.

50:06 But it really is.

50:08 And like you said, you almost have to live through it to experience it.

50:12 The one example that I have of that is I did training, software developer training, in-person training for quite a while.

50:17 And in the course of a month, I had taught a course to developers at a hedge fund in New York City who were doing high speed trading type of stuff.

50:28 And I also taught a course to engineers at Edwards Air Force Base.

50:33 And after those two experiences, I'm like, you know what?

50:35 These people need to know like 90% the same thing.

50:39 It's just that little 10% where you take that knowledge and apply it to, you know, low latency stocks, stock trading versus reliable airplanes or whatever it is you're trying to do.

50:50 But like mostly what you need to know is actually really, really similar, which blew my mind.

50:56 And, you know, I would have the same experience between like restaurants and rockets, right?

51:02 Yeah.

51:02 And even for me, like for Python, it's the stuff, the Python you need to know for web development.

51:07 Like a lot of it is the same Python you need to know for data science.

51:10 And so like that's been a huge plus for me in using Python was like, okay, I know Python for data because that's what I do.

51:17 I now need to build a web app for something.

51:19 Like I need to build a static blog for myself.

51:22 Cool.

51:23 The stuff that I use for data science transfers to static hosts, like static sites and web hosting because it's Python.

51:29 Like I don't have to learn a new language.

51:32 I just, I can transfer within the community and it's just so flexible to jump from one area to another.

51:36 You talked about Instagram doing their, Instagram is a company that's doing as a social media site.

51:41 And the Python that's being used there is very similar to the Python that I use.

51:45 That's weekly.

51:46 Now to your point, like they've got that 10% of specialization or whatever,

51:49 but it's so good to know that I can take this language and this set of knowledge and move between different organizations.

51:55 It's awesome to be quite honest.

51:57 Yeah.

51:57 As a person who has those skills, you know, looking for different jobs.

52:00 It's, it's super cool.

52:01 I suspect there's probably some cool lessons that could cross pollinate across these industries that hasn't yet.

52:08 Just because, you know, most people maybe haven't made that connection.

52:11 And even if you have that theoretically, you don't actually have the interactions across the industries that much, but I bet there are.

52:17 That's actually, so this is one reason I actually really like this podcast in particular is because you go across all these industries.

52:22 Like I've been listening to these like, oh, that they do that in web development.

52:25 Like that's, that's a, that's a great idea.

52:26 I want to just take that idea and like do it over here.

52:28 Like we're doing that.

52:30 We're doing that.

52:31 This is a good idea.

52:32 Awesome.

52:33 Thanks.

52:33 I guess maybe that we're just about out of time.

52:37 Maybe one more question that I'd like to ask you sort of a high level closing things out is, you know, what, what do you find exciting in the world of programming and Python these days?

52:47 Like what's amazing right now?

52:49 You know, I'd say the thing I like about Python the most is, is the community of people.

52:53 When I started using Python, I wasn't thinking about the community, but as I got more and more into the programming language, just the people you tend to meet like yourself here, but I'm meeting people online who are friendly and helpful and are just great people to interact with.

53:06 When I, when I used to go to conferences, because right now I can't go to conferences for reference where this is a middle of COVID, but like, it's so exciting to go to SciPy and see all of these folks that are excited about what they're being, what they're able to do.

53:19 Like detect earthquakes, find cancer, do RNA sequencing or whatever, and share like that knowledge of moving, moving.

53:26 So I honestly think moving the world forward.

53:28 I really enjoy just being part of these, these doers that are sitting around using Python to do a thing and do the thing they're passionate about and make that thing better.

53:35 And then even so much to even explain it to me, who's an idiot about biology and things like that, but explain it to me in a language as Python that I know.

53:42 And that is the most fascinating, exciting thing to me.

53:44 And I really love being a part of that.

53:45 Awesome.

53:45 I love the way you put it, that, you know, just be part of all these doers.

53:49 Yeah.

53:49 Building stuff and making things happen with Python.

53:52 It's very cool.

53:52 I think the thing that inspires me really is like, I can almost just imagine anything and then I can find people doing that with Python and polished libraries that make it accessible to many more people.

54:04 Right?

54:04 Like I said, Oh, well, what about like rocketry and like, you know, rocket stuff with fire.

54:09 Here's like, Oh yeah, here's like five or six libraries for simulating that just so you can test it before you actually do your real, I mean, it's just like, you know, you name it and it's probably out there.

54:18 That's so cool.

54:19 I mean, you were talking about this earlier, but I've definitely met people using Python and F1 at a conferences.

54:23 I was like, what are you doing here?

54:24 You work for Red Bull?

54:25 Like, why are you at this tech programming conference?

54:28 Like, Oh, we use Python all the time.

54:29 We do stuff with that phone car.

54:30 It's like a classic example.

54:32 Yeah.

54:32 I would love to dig into what people are doing and like high-end racing F1 IndyCar and stuff with Python.

54:39 And it's going to be hard to find someone able and willing to talk about it because those groups are so secretive.

54:44 But yeah, the technology behind those types of events and engineering projects.

54:49 I mean, the engineering behind F1 cars, they have hundreds of employees.

54:53 Oh yeah.

54:54 It's crazy.

54:55 So much stuff is built from scratch.

54:56 Yeah, yeah, exactly.

54:58 Someday maybe I'll be able to talk about that, but it's tricky.

55:01 If someone wants to be on the show and they work in that space, let's chat.

55:05 So anyway, all right.

55:06 Well, it's definitely an exciting time to be in programming and Python.

55:10 And all the stories you've told here are definitely a part of it.

55:13 So before you're out of here, though, I've got the two final questions for you.

55:17 When you write some Python code, what editor do you use?

55:19 Okay.

55:19 I'm going to cheat a little bit here because we talked about three levels.

55:22 So if I'm at level one, which is my early start, I just use Vim and Tmux because I just need a script.

55:26 Single file and I'm done.

55:27 If it's a complex program like RVs or PyMC3, PyCharm is my go-to.

55:31 And then if it's exploratory analysis, JupyterLab.

55:35 So I'm in one of those three writing Python.

55:37 Yeah.

55:37 Awesome.

55:38 And it's probably not exclusive with the last two.

55:40 Like maybe sometimes PyCharm fits, sometimes Jupyter fits, depending on what you're doing, right?

55:45 The Venn diagrams are fuzzy.

55:46 Sometimes it's one or the other.

55:47 There's a lot of blurry spaces.

55:49 Maybe even both.

55:50 Who knows?

55:50 Yeah.

55:51 And then notable PyPI package throughout the two that you work on, right?

55:55 PyMC3 and RVs.

55:56 Yep.

55:57 But I think the one I want to call a shout out to is X-Ray.

55:59 I think that package can use a lot of publicity.

56:03 I think it's an awesome package because it basically takes Pandas and makes it more than 2D.

56:07 It makes it multidimensional.

56:08 And I think the developers are doing just a great job over there building that out and making it awesome.

56:13 And community-wise, we use it in RVs.

56:16 And those developers have been nice enough to jump on Google Hangouts with us and talk to us and give us tips for what we should do.

56:24 So plus one to the library and plus one to the people that are putting it in open source for everyone else to use.

56:29 That's cool.

56:29 So it's a little bit like Pandas, but more n-dimensional, 3, 4, 10-dimensional type stuff.

56:34 Yeah.

56:34 Pandas with more dimensions.

56:35 Yeah.

56:36 And n-dimensions.

56:36 As many dimensions as you want.

56:38 As many dimensions as fits in memory.

56:39 I've actually heard a lot of recommendations for X-Ray lately.

56:43 I think it's getting a lot of traction.

56:44 So that's awesome.

56:45 Cool.

56:45 All right, Revan.

56:46 Thank you so much for being here and telling your story.

56:48 People are interested in this whole supply chain plus Python, maybe Beijing as well.

56:54 Final call to action.

56:55 What should they do?

56:56 There's two ways.

56:57 If you have a job, just see where you can automate the boring things, as he said.

57:01 And if you don't have a job, or even if you do have a job, just get into open source.

57:04 There's so many things you can do in open source.

57:06 You don't have to be a Python expert.

57:07 You don't really even have to know tons of Python.

57:10 You just have to have the willingness to want to join in and be a positive contributor.

57:14 And that's the magic that keeps all of this going, is the community efforts of good people

57:20 that are just putting their work out there and trying to move the ball forward.

57:23 Yeah.

57:23 And I also want to say, your story is the story of you don't have to start huge.

57:29 You can start small with little bits of automation, and you'll see where it takes you.

57:32 Exactly.

57:33 Yep.

57:33 It's pretty much life-changing, to be quite honest.

57:36 I know.

57:37 I hear you.

57:38 That's awesome.

57:39 All right.

57:40 Well, thank you so much for being on the show.

57:41 It was great to chat with you.

57:42 A lot of fun.

57:42 Thanks, Michael.

57:43 You bet.

57:43 Bye.

57:44 This has been another episode of Talk Python to Me.

57:47 Our guest in this episode was Ravine Kumar.

57:49 It's been brought to you by Sentry and Linode.

57:52 Take some stress out of your life.

57:54 Get notified immediately about errors in your web applications with Sentry.

57:59 Just visit talkpython.fm/sentry and get started for free.

58:03 Start your next Python project on Linode's state-of-the-art cloud service.

58:08 Just visit talkpython.fm/Linode, L-I-N-O-D-E.

58:12 You'll automatically get a $20 credit when you create a new account.

58:15 Want to level up your Python?

58:17 If you're just getting started, try my Python Jumpstart by Building 10 Apps course.

58:22 Or if you're looking for something more advanced, check out our new Async course that digs into

58:27 all the different types of Async programming you can do in Python.

58:30 And of course, if you're interested in more than one of these, be sure to check out our

58:34 Everything Bundle.

58:35 It's like a subscription that never expires.

58:37 Be sure to subscribe to the show.

58:39 Open your favorite podcatcher and search for Python.

58:42 We should be right at the top.

58:43 You can also find the iTunes feed at /itunes, the Google Play feed at /play,

58:47 and the direct RSS feed at /rss on talkpython.fm.

58:52 This is your host, Michael Kennedy.

58:54 Thanks so much for listening.

58:55 I really appreciate it.

58:56 Now get out there and write some Python code.

58:58 I'll see you next time.

Back to show page
Talk Python's Mastodon Michael Kennedy's Mastodon