WEBVTT

00:00:00.001 --> 00:00:03.480
Do you have a scientific system that needs optimization or solving?

00:00:03.480 --> 00:00:07.740
Our guest on this episode, Clark Petrie, is here to tell us all about Pyomo.

00:00:07.740 --> 00:00:10.480
This is a library that can solve all sorts of cool problems,

00:00:10.480 --> 00:00:14.460
linear programming, nonlinear equations, and many other things that you can throw at it.

00:00:14.460 --> 00:00:16.740
We're going to solve a really fun diet problem.

00:00:16.740 --> 00:00:20.740
What is the most nutritious meal that you can eat for the least amount of money?

00:00:20.740 --> 00:00:23.520
The answer might surprise you a little bit. It's going to be a lot of fun.

00:00:23.520 --> 00:00:27.400
So listen in to hear about how Clark has used Pyomo to do his work

00:00:27.400 --> 00:00:29.140
and how you might use it in yours.

00:00:29.360 --> 00:00:34.220
This is Talk Python To Me, episode 291, recorded October 1st, 2020.

00:00:34.220 --> 00:00:50.180
Welcome to Talk Python To Me, a weekly podcast on Python,

00:00:50.180 --> 00:00:52.960
the language, the libraries, the ecosystem, and the personalities.

00:00:52.960 --> 00:00:54.760
This is your host, Michael Kennedy.

00:00:54.760 --> 00:00:56.960
Follow me on Twitter where I'm @mkennedy,

00:00:57.100 --> 00:01:00.700
and keep up with the show and listen to past episodes at talkpython.fm

00:01:00.700 --> 00:01:03.760
and follow the show on Twitter via at Talk Python.

00:01:03.760 --> 00:01:07.520
This episode is brought to you by Linode and Talk Python Training.

00:01:07.520 --> 00:01:09.820
Please check out the offers during their segments.

00:01:09.820 --> 00:01:11.140
It really helps support the show.

00:01:11.140 --> 00:01:14.220
Hey everyone, two quick announcements before we jump into the show.

00:01:14.220 --> 00:01:19.380
Number one, I really appreciate everything that many of you are doing to support us here at Talk Python

00:01:19.380 --> 00:01:22.300
and make it possible for this to be my full-time job.

00:01:22.760 --> 00:01:26.380
Our primary means of support is through the courses over at Talk Python Training,

00:01:26.380 --> 00:01:29.680
and I've been thinking about how I can offer you something special in return.

00:01:29.680 --> 00:01:34.380
What I've come up with is something I'm calling Talk Python To Me Pro Edition.

00:01:34.680 --> 00:01:37.360
It's like regular Talk Python, but it comes with two perks.

00:01:37.360 --> 00:01:40.720
It is ad-free so you can listen without any interruptions,

00:01:40.720 --> 00:01:45.600
and you'll have the entire history going back five years to episode zero in your podcast player.

00:01:45.600 --> 00:01:51.280
Talk Python To Me Pro is available exclusively to listeners who have an everything bundle over at Talk Python Training.

00:01:51.280 --> 00:01:56.240
If this sounds like something you want, learn more at talkpython.fm/pro.

00:01:56.720 --> 00:02:01.940
And if you already have a course bundle, just visit that link for details on how to add the Pro Edition to your podcast player.

00:02:01.940 --> 00:02:05.740
Announcement number two, somewhat related to Talk Python Pro,

00:02:05.740 --> 00:02:09.460
Black Friday is just around the corner if you're listening to this episode right when it comes out.

00:02:09.460 --> 00:02:13.480
We'll be offering major discounts on our brand new FastAPI course

00:02:13.480 --> 00:02:18.400
and on our everything course bundle over at Talk Python Training for just four days.

00:02:18.400 --> 00:02:23.420
So visit talkpython.fm/Black Friday to get notified when the deals go live.

00:02:23.420 --> 00:02:25.220
Thanks so much for your support.

00:02:25.220 --> 00:02:27.820
Even if you're just listening, it really means a lot.

00:02:27.820 --> 00:02:28.400
Thank you.

00:02:28.400 --> 00:02:31.160
Now, let's optimize some things with Python.

00:02:31.160 --> 00:02:33.740
Clark, welcome to Talk Python To Me.

00:02:33.740 --> 00:02:34.120
All right.

00:02:34.120 --> 00:02:34.580
Thank you, Michael.

00:02:34.580 --> 00:02:35.220
I'm happy to be here.

00:02:35.220 --> 00:02:36.800
Yeah, I'm happy to have you here.

00:02:36.800 --> 00:02:41.600
And we're going to talk about operational resilience and using a package called Pyomo,

00:02:41.600 --> 00:02:44.560
which is about solving all these constraint problems,

00:02:44.740 --> 00:02:48.600
which brings me back to my math roots, right?

00:02:48.600 --> 00:02:50.460
Like I didn't do that much applied math,

00:02:50.460 --> 00:02:53.540
but I definitely studied a ton of math before I got deep into programming.

00:02:53.540 --> 00:02:55.320
So it'll be a fun journey, I think.

00:02:55.320 --> 00:02:55.980
Happy to have you.

00:02:55.980 --> 00:02:57.380
Yeah, this is a lot of fun for me.

00:02:57.380 --> 00:02:58.740
I've been a fan of the show for a while,

00:02:58.740 --> 00:03:02.200
and it's kind of surreal to be sitting here talking to you right now.

00:03:02.200 --> 00:03:03.580
So this is exciting and fun,

00:03:03.580 --> 00:03:06.620
and I'm happy to spread the joy of Pyomo to the audience.

00:03:06.620 --> 00:03:08.900
Yeah, and honestly, I had not heard of Pyomo.

00:03:08.900 --> 00:03:13.220
I obviously know about some of these like solver type systems and the general concept,

00:03:13.380 --> 00:03:15.740
but I've never used Pyomo and it looks really cool.

00:03:15.740 --> 00:03:19.360
We have a really fun and slightly comedic,

00:03:19.360 --> 00:03:24.680
but honestly serious example to go through as well to give people a sense of like the kinds of problems we're solving.

00:03:24.680 --> 00:03:27.260
But, you know, that's not where we start the show, right?

00:03:27.260 --> 00:03:28.460
We start with your story.

00:03:28.460 --> 00:03:29.320
So let's start there.

00:03:29.320 --> 00:03:30.840
How did you get into programming and Python?

00:03:30.840 --> 00:03:33.880
I mean, I took a really roundabout way to get there.

00:03:33.940 --> 00:03:39.480
Just for, I guess, audience context, I was born in 81 and grew up in rural Northern California,

00:03:39.480 --> 00:03:42.240
kind of one of the few tech nerds in a one-stop-light town.

00:03:42.240 --> 00:03:44.240
I mean, there was literally a girl that rode a horse to school.

00:03:44.240 --> 00:03:45.980
I'm not even joking about that.

00:03:45.980 --> 00:03:46.560
No way.

00:03:46.560 --> 00:03:47.340
That's crazy.

00:03:47.340 --> 00:03:47.620
Yeah.

00:03:47.620 --> 00:03:49.620
We had these like ag fields out back,

00:03:49.620 --> 00:03:53.060
and she would sometimes ride her horse to school and just put the horse out to pasture during the day.

00:03:53.060 --> 00:03:54.520
That's actually really cool.

00:03:54.520 --> 00:03:55.540
It was neat for her.

00:03:55.660 --> 00:04:00.940
I was not into that, but like, especially looking back now, I can go, that's pretty legit.

00:04:00.940 --> 00:04:01.460
Yeah.

00:04:01.460 --> 00:04:05.960
But, you know, like I said, I was one of the few tech nerd kids, and I remember the early days of AOL,

00:04:05.960 --> 00:04:11.280
and I was actually making money as like a sophomore making web pages for local businesses.

00:04:11.280 --> 00:04:11.960
Okay.

00:04:11.960 --> 00:04:12.340
Yeah.

00:04:12.340 --> 00:04:15.020
I guess the HTML that I did all by hand back then,

00:04:15.020 --> 00:04:17.880
you could say it was my first experience programming, so to speak.

00:04:17.880 --> 00:04:20.480
I did a little bit of IRC bot coding.

00:04:20.480 --> 00:04:24.160
I loved trying to make what we now think of as like a chat bot,

00:04:24.300 --> 00:04:25.820
but I'd had some foresight.

00:04:25.820 --> 00:04:31.380
I could tell there was a future in that, but it was just for me, it was a toy, and I love that stuff.

00:04:31.380 --> 00:04:36.040
But it was just me and a single mom predominantly who, despite her best efforts,

00:04:36.040 --> 00:04:37.640
didn't really know how to guide me to college.

00:04:37.640 --> 00:04:42.480
So I kind of stumbled into joining the military, specifically the Navy, right after high school in 99.

00:04:42.480 --> 00:04:45.160
Fast forward to actually get to answering your question.

00:04:45.160 --> 00:04:48.060
They cultivated my potential.

00:04:48.060 --> 00:04:53.100
I eventually got commissioned as an officer, and in 2015, I got sent to the Naval Postgraduate School

00:04:53.100 --> 00:04:55.560
for the Operations Research Curriculum, which...

00:04:55.560 --> 00:04:56.240
That sounds really cool.

00:04:56.240 --> 00:04:58.320
I often will colloquially...

00:04:58.320 --> 00:05:00.040
Yeah, it was a great opportunity.

00:05:00.040 --> 00:05:01.840
I mean, I got paid to go to grad school, so I can't...

00:05:01.840 --> 00:05:06.160
I'm like the luckiest guy around, which for someone that hasn't heard of OR,

00:05:06.160 --> 00:05:09.560
a lot of us will just kind of cheat and just call it applied mathematics,

00:05:09.560 --> 00:05:10.920
compared to...

00:05:10.920 --> 00:05:14.520
I hope I'm not offending any actual math masters out there.

00:05:14.880 --> 00:05:18.240
But from looking at the curriculum, you know, we just kind of drop a few math classes,

00:05:18.240 --> 00:05:21.640
add in a few programming classes, which, to answer your question, in the first quarter,

00:05:21.640 --> 00:05:23.240
we took a Python course.

00:05:23.240 --> 00:05:23.860
And I just...

00:05:23.860 --> 00:05:31.280
I kind of fell in love and quickly realized that was the main technical tool I wanted to

00:05:31.280 --> 00:05:36.780
cultivate for my time in school, and also what I wanted to really use in whatever thesis

00:05:36.780 --> 00:05:37.780
I ultimately ended up doing.

00:05:37.780 --> 00:05:39.620
And here we are now.

00:05:39.620 --> 00:05:40.720
Yeah, here you are.

00:05:40.780 --> 00:05:44.500
You've done your thesis with Pyomo and Python, and we're going to talk about it.

00:05:44.500 --> 00:05:44.840
That'd be great.

00:05:44.840 --> 00:05:45.180
Yeah.

00:05:45.180 --> 00:05:46.720
So it's never too late to learn to code.

00:05:46.720 --> 00:05:47.660
I mean, heck, I was...

00:05:47.660 --> 00:05:47.840
Yeah.

00:05:47.840 --> 00:05:48.720
...35.

00:05:48.720 --> 00:05:49.320
Yeah.

00:05:49.320 --> 00:05:51.000
And when I started that, so...

00:05:51.000 --> 00:05:54.200
Well, I wasn't quite that far along, but I hear a lot of stories from people like,

00:05:54.200 --> 00:05:55.880
oh, I started that when I was four.

00:05:55.880 --> 00:05:59.940
Like, as soon as I could sort of kind of read, I was on the computer and whatnot.

00:05:59.940 --> 00:06:02.460
And for me, it wasn't that way at all.

00:06:02.460 --> 00:06:07.900
It was basically grad school, almost grad school, senior year of college, doing research projects,

00:06:07.900 --> 00:06:11.880
going to actually need some programming skills to start answering these questions.

00:06:11.880 --> 00:06:16.260
But once I got into it, it was like, why have I been studying this other stuff?

00:06:16.260 --> 00:06:17.380
This is way more fun.

00:06:17.380 --> 00:06:18.400
How do I do more of this?

00:06:18.400 --> 00:06:20.120
And less of what, I'm actually getting my degree in.

00:06:20.120 --> 00:06:22.660
That was a bit of a problem, but it worked out in the end, I suppose.

00:06:22.660 --> 00:06:23.300
Yeah.

00:06:23.300 --> 00:06:23.600
Yeah.

00:06:23.600 --> 00:06:28.600
I did similar stuff where I kind of juggled around electives to take more programming classes

00:06:28.600 --> 00:06:30.960
while I was there because I was enjoying it so much.

00:06:30.960 --> 00:06:34.180
I kind of put off other pain until later, I guess you could say.

00:06:35.140 --> 00:06:35.500
Exactly.

00:06:35.500 --> 00:06:38.740
So what is operations research?

00:06:38.740 --> 00:06:41.020
Like, what kind of problems are being solved there?

00:06:41.020 --> 00:06:42.700
Give people a sense of what that means.

00:06:42.700 --> 00:06:47.840
So from the military perspective in particular, a lot of it is logistics and optimization.

00:06:47.840 --> 00:06:51.920
So in that curriculum, there's kind of three main tracks people tend to fall down.

00:06:51.920 --> 00:06:53.360
One is the optimization track.

00:06:53.360 --> 00:06:54.660
You could say that's where I went.

00:06:54.660 --> 00:07:00.060
Another is more of a just data analysis track, a lot of regression analysis.

00:07:00.760 --> 00:07:03.280
And the third would be simulations.

00:07:03.280 --> 00:07:08.780
And I guess you could say just trying to drive answers through some kind of simulation theory.

00:07:08.780 --> 00:07:14.000
So within operations research, we're looking to find the best way to go about doing something.

00:07:14.000 --> 00:07:17.660
So some of those classic computer science problems exist in that domain, I'd say.

00:07:17.660 --> 00:07:20.420
You know, the traveling salesman problem is an early one.

00:07:20.420 --> 00:07:21.000
Right.

00:07:21.080 --> 00:07:23.640
And it's about doing that at scale for...

00:07:23.640 --> 00:07:25.200
The Euler Bridge problem.

00:07:25.200 --> 00:07:25.600
Yep.

00:07:25.600 --> 00:07:26.200
That one.

00:07:26.200 --> 00:07:27.000
That seven bridges.

00:07:27.000 --> 00:07:27.520
City.

00:07:27.520 --> 00:07:28.440
I forgot the name of the city.

00:07:28.440 --> 00:07:28.800
Yeah.

00:07:28.800 --> 00:07:32.400
You know, we go through some of the classic use cases during World War II with like...

00:07:32.400 --> 00:07:35.160
God, like...

00:07:35.160 --> 00:07:35.340
I don't know.

00:07:35.340 --> 00:07:36.780
It might have been post-World War II, I want to say.

00:07:36.780 --> 00:07:40.040
But like looking at the Soviet railway system and how...

00:07:40.040 --> 00:07:41.660
What's the minimum cut, right?

00:07:41.660 --> 00:07:46.160
To essentially disable their railway system if they were to invade Europe.

00:07:46.160 --> 00:07:46.620
Right.

00:07:46.960 --> 00:07:49.500
And it's a lot of work in that domain.

00:07:49.500 --> 00:07:49.860
Yeah.

00:07:49.860 --> 00:07:50.340
Okay.

00:07:50.340 --> 00:07:51.540
Pretty interesting.

00:07:51.540 --> 00:07:54.720
And I'm still looking forward to the example we're going to get to.

00:07:54.720 --> 00:07:56.000
Yeah, I'm so goofy.

00:07:56.000 --> 00:07:58.820
And contrast it with the seriousness of these things.

00:07:58.820 --> 00:08:00.260
But how about day-to-day?

00:08:00.260 --> 00:08:02.020
Like, what are you doing now?

00:08:02.020 --> 00:08:06.840
So right now, I'm a senior officer working in the Pentagon as a data analyst.

00:08:06.840 --> 00:08:08.500
Let me just really quick.

00:08:08.500 --> 00:08:10.000
I got to get the obligatory.

00:08:10.000 --> 00:08:13.060
The views and opinions expressed here are mine and mine alone.

00:08:13.060 --> 00:08:16.760
They do not represent the U.S. government, the Department of Defense, or the U.S. Navy.

00:08:17.020 --> 00:08:17.880
So there we go.

00:08:17.880 --> 00:08:18.600
I said it.

00:08:18.600 --> 00:08:19.320
We're safe.

00:08:19.320 --> 00:08:23.780
This is the world of Piomo, according to Clark, not the U.S.

00:08:23.780 --> 00:08:24.280
Okay, got it.

00:08:24.280 --> 00:08:25.000
Yeah, got it.

00:08:25.000 --> 00:08:28.920
So basically, I work for a three-star admiral, which is pretty darn senior.

00:08:28.920 --> 00:08:31.940
And he is in charge of the entire Navy Reserve.

00:08:31.940 --> 00:08:37.080
So for kind of civilian context, you could think of that as a multi-billion dollar company with 60,000 people.

00:08:37.080 --> 00:08:37.480
Yeah.

00:08:37.480 --> 00:08:38.240
Wow, okay.

00:08:38.240 --> 00:08:39.860
And he's the CEO, if you will.

00:08:39.860 --> 00:08:43.820
And at the Pentagon level, and we have, you know, it's the military, so everything's tiered.

00:08:43.880 --> 00:08:44.420
It's very vertical.

00:08:44.420 --> 00:08:47.340
And I'm one of his two data guys, basically.

00:08:47.340 --> 00:08:57.540
And we have one never-ending project, which is we're always analyzing and forecasting our personnel strength, which is a multivariate problem in and of itself.

00:08:57.880 --> 00:09:05.880
We got to look at, as the Navy Reserve, we receive people that leave the active duty Navy, but we also can recruit off the street.

00:09:05.880 --> 00:09:20.180
So we get folk that are coming straight into the Navy Reserve, those that are leaving active duty, and we have to try to plan out how many people we're going to have, and do we have the right types of people for all of our different missions across the future years defense program, which is sort of the budgetary outlook.

00:09:20.540 --> 00:09:21.760
That's our main job.

00:09:21.760 --> 00:09:32.840
But honestly, we probably spend more of our time just digging into random data for whatever the Admiral needs to be educated on, the other senior decision makers in the Pentagon, so they can go forth and move out.

00:09:32.840 --> 00:09:34.460
COVID was a big example of that.

00:09:34.460 --> 00:09:35.200
It's funny.

00:09:35.440 --> 00:09:42.240
You have the world shut down with COVID, and literally the Joint Chiefs of Staff are coming to us wanting answers now, like right now, right?

00:09:42.240 --> 00:09:42.540
Yeah.

00:09:42.540 --> 00:09:43.780
You got to tell us this.

00:09:43.780 --> 00:09:45.060
So, yeah.

00:09:45.060 --> 00:09:58.000
So it was me and my counterpart who got really smart on a pretty thorough analysis and built a unified data project to answer anything about Navy Reserve medicine, because we have doctors and nurses and critical care and all that in the Navy Reserve.

00:09:58.000 --> 00:10:06.120
So how many do we have, and if we pull them to go to New York, are we pulling them from a hospital in another hot spot in their civilian life because they're a reservist?

00:10:06.120 --> 00:10:11.540
And so that's answering questions like that as a recent example, you could say, is what I do.

00:10:11.540 --> 00:10:11.840
Okay.

00:10:11.840 --> 00:10:12.340
Yeah.

00:10:12.340 --> 00:10:13.480
Two things I want to talk about.

00:10:13.480 --> 00:10:18.520
One is we saw the nightmare that was the cruise ship industry, right?

00:10:18.520 --> 00:10:19.100
Yes.

00:10:19.280 --> 00:10:25.200
And I think there's still people around the world who are still stuck on these cruise ships, right?

00:10:25.200 --> 00:10:27.640
Like not cruisers, right?

00:10:27.640 --> 00:10:29.300
They were taken and put somewhere.

00:10:29.300 --> 00:10:33.280
I remember, like, I guess it varied where you were, but people who worked on the cruise ships.

00:10:33.280 --> 00:10:34.940
I think there's still a ton of them stuck there.

00:10:34.940 --> 00:10:36.540
And that's just insane.

00:10:36.540 --> 00:10:42.820
And yet, I used to live in Coronado, California, a little island outside of San Diego for a little bit.

00:10:42.820 --> 00:10:46.580
And there was two of the main aircraft carrier station there.

00:10:46.580 --> 00:10:48.380
I know that pier very, very well.

00:10:48.640 --> 00:10:50.040
It's a beautiful place.

00:10:50.040 --> 00:10:55.600
But the reason I bring that up is literally the traffic would change.

00:10:55.600 --> 00:11:01.720
The traffic patterns would change how much traffic there was and whether or not the aircraft carriers were home or they were gone.

00:11:01.720 --> 00:11:06.120
Because there are so many, there's like 5,000 people on an aircraft carrier, something like that.

00:11:06.120 --> 00:11:06.500
Yeah.

00:11:06.500 --> 00:11:09.660
If the, so this is, you're getting really into my wheelhouse.

00:11:09.660 --> 00:11:15.220
My first 10 years as an officer, I was one of the nuclear engineers for aircraft carrier reactor plants.

00:11:15.220 --> 00:11:15.660
Oh, wow.

00:11:15.660 --> 00:11:15.900
Okay.

00:11:15.900 --> 00:11:20.640
Which is why I had the technical aptitude to do the ops research program for like eligibility.

00:11:20.640 --> 00:11:25.520
And yeah, if the carrier has the air wing embarked, you're looking at 5,000 or 6,000 people.

00:11:25.520 --> 00:11:26.000
Yeah.

00:11:26.060 --> 00:11:30.620
And when the air wing, all the planes and everything associated there is not there, you're talking about 3,000.

00:11:30.620 --> 00:11:35.180
Either way, whether a carrier is important or not changes the quality of life for a commuter for sure.

00:11:35.960 --> 00:11:36.240
Yeah.

00:11:36.240 --> 00:11:37.220
I mean, it would change.

00:11:37.220 --> 00:11:38.300
It would dramatically change.

00:11:38.300 --> 00:11:39.320
So why do I bring that up?

00:11:39.320 --> 00:11:44.740
Well, you guys got these, I mean, that's the same size as a cruise ship or bigger and you've got all these people on there.

00:11:44.740 --> 00:11:46.060
And that's a huge challenge.

00:11:46.060 --> 00:11:47.620
I mean, how did you all deal with that?

00:11:47.620 --> 00:11:48.800
What was even the outcome?

00:11:48.800 --> 00:11:55.740
I know that there was a commander of one of those carriers that was lost his job basically.

00:11:55.740 --> 00:11:58.040
Because he spoke out about like, this is a serious problem.

00:11:58.040 --> 00:12:02.500
He was very upset and kind of went above rank or pulled rank or something like that, right?

00:12:02.500 --> 00:12:03.020
Yeah.

00:12:03.020 --> 00:12:05.700
I mean, I can't really like, I wasn't there, right?

00:12:05.700 --> 00:12:07.840
But I can only report what I kind of saw in the news.

00:12:07.840 --> 00:12:10.520
I don't have much insider information, if you will.

00:12:10.520 --> 00:12:15.000
But we take rank and reporting at the chain very seriously.

00:12:15.000 --> 00:12:17.100
And I feel for that gentleman.

00:12:17.100 --> 00:12:19.340
My job before this was as a commanding officer.

00:12:19.340 --> 00:12:22.620
And he was facing incredibly tough decisions.

00:12:22.620 --> 00:12:24.460
And it's just, the whole thing's unfortunate.

00:12:24.860 --> 00:12:30.320
But as far as what you're getting at with like the cruise ships that are dealing with such rampant COVID problems,

00:12:30.320 --> 00:12:31.240
yeah, that's really tough.

00:12:31.240 --> 00:12:33.500
Because on a ship, where are you going to go, right?

00:12:33.500 --> 00:12:33.900
Yeah.

00:12:33.900 --> 00:12:39.720
But one way that I think we haven't been as decimated is the wrong word,

00:12:39.720 --> 00:12:42.320
but maybe negatively impacted with our ships,

00:12:42.320 --> 00:12:46.620
partially because generally, most of the sailors on ships,

00:12:46.620 --> 00:12:50.080
and the average age of a Navy sailor is like 21 years old.

00:12:50.080 --> 00:12:51.940
We're talking pretty healthy people.

00:12:52.400 --> 00:12:55.120
Which is probably not the same age as the average cruiser.

00:12:55.120 --> 00:12:57.240
I do love a good time on a cruise ship.

00:12:57.240 --> 00:13:00.860
But if I need to feel young, I can also do that, right?

00:13:00.860 --> 00:13:01.740
Yeah, right.

00:13:01.740 --> 00:13:06.800
So I think there's probably some degree of extra resilience, I would think,

00:13:06.800 --> 00:13:10.220
amongst our personnel on ships that has probably helped mitigate the problem.

00:13:10.220 --> 00:13:10.980
And I'll tell you this.

00:13:11.520 --> 00:13:13.960
We have also had, we're the military, right?

00:13:13.960 --> 00:13:15.320
And we need to be ready.

00:13:15.320 --> 00:13:23.160
The restrictions in place on us for doing things that would possibly increase your risk profile are pretty strict.

00:13:23.160 --> 00:13:23.520
Yeah.

00:13:23.760 --> 00:13:31.500
Like, even though I'm in Northern Virginia, you know, my wife can, she could go out and go eat and hug everyone she wants to hug.

00:13:31.680 --> 00:13:33.920
But like, if I were to go, I'll give you an example.

00:13:33.920 --> 00:13:41.900
One of my big personal hobbies outside of nerd stuff is I'm a big Brazilian jujitsu guy, which is really mean wrestling, if you will.

00:13:41.900 --> 00:13:42.300
Yeah.

00:13:42.300 --> 00:13:44.720
It's cool, but it's also kind of up close with other people.

00:13:44.720 --> 00:13:45.060
Yeah.

00:13:45.060 --> 00:13:48.300
There's no way to socially distance when you're rolling around with people, right?

00:13:48.340 --> 00:13:54.860
And if I were to go do that and get COVID, technically speaking, I would have disobeyed like a direct order.

00:13:54.860 --> 00:13:55.280
Right.

00:13:55.280 --> 00:13:59.100
You know, and I'm senior enough that I probably wouldn't get like in real trouble, if you will.

00:13:59.100 --> 00:14:01.260
But I know, like, I'm a good boy.

00:14:01.260 --> 00:14:01.740
So.

00:14:01.740 --> 00:14:02.440
Yeah.

00:14:02.440 --> 00:14:05.960
The restrictions in place like that are probably protecting our people more.

00:14:05.960 --> 00:14:06.380
Sure.

00:14:06.380 --> 00:14:12.520
Well, and also just like what you do on a cruise ship, like you go from port to port and you go out and experience those places.

00:14:12.520 --> 00:14:14.480
Whereas you can say, you know what?

00:14:14.480 --> 00:14:16.620
We're not going to go into port and you guys don't go anywhere.

00:14:16.620 --> 00:14:17.660
You stay here.

00:14:17.940 --> 00:14:20.540
Which is a different kind of experience, I guess.

00:14:20.540 --> 00:14:20.880
Yeah.

00:14:20.880 --> 00:14:24.060
No more pulling into Hong Kong and going wild, I suppose.

00:14:24.060 --> 00:14:27.180
It's probably restricted liberty when the ships do pull in.

00:14:27.180 --> 00:14:27.840
Yeah, exactly.

00:14:27.840 --> 00:14:29.320
But I'm a desk jockey now.

00:14:29.320 --> 00:14:30.780
My ship going days are way behind me.

00:14:30.780 --> 00:14:35.660
This portion of Talk Python To Me is sponsored by Linode.

00:14:35.660 --> 00:14:40.000
Simplify your infrastructure and cut your cloud bills in half with Linode's Linux virtual machines.

00:14:40.000 --> 00:14:44.080
Develop, deploy, and scale your modern applications faster and easier.

00:14:44.080 --> 00:14:47.480
Whether you're developing a personal project or managing large workloads,

00:14:47.540 --> 00:14:51.480
you deserve simple, affordable, and accessible cloud computing solutions.

00:14:51.480 --> 00:14:55.740
As listeners of Talk Python To Me, you'll get a $100 free credit.

00:14:55.740 --> 00:14:59.860
You can find all the details at talkpython.fm/Linode.

00:14:59.860 --> 00:15:05.600
Linode has data centers around the world with the same simple and consistent pricing, regardless of location.

00:15:05.860 --> 00:15:08.440
Just choose the data center that's nearest to your users.

00:15:08.440 --> 00:15:15.140
You'll also receive 24-7, 365 human support with no tiers or handoffs, regardless of your plan size.

00:15:15.140 --> 00:15:22.560
You can choose shared and dedicated compute instances, or you can use your $100 in credit on S3 compatible object storage,

00:15:22.560 --> 00:15:25.360
managed Kubernetes clusters, and more.

00:15:25.800 --> 00:15:27.840
If it runs on Linux, it runs on Linode.

00:15:27.840 --> 00:15:32.520
Visit talkpython.fm/Linode or click the link in your show notes,

00:15:32.520 --> 00:15:35.220
then click that create free account button to get started.

00:15:36.000 --> 00:15:37.360
Got your land legs back.

00:15:37.360 --> 00:15:42.760
Okay, so let's talk a little bit about, let me just ask you about Python and the government,

00:15:42.760 --> 00:15:44.600
our programming and the government.

00:15:44.600 --> 00:15:53.940
I did 10 years of in-person training, and much of that was at places that were like HP or JP Morgan or something like that.

00:15:53.940 --> 00:15:57.500
But periodically, we teach classes at military places.

00:15:58.040 --> 00:15:59.540
And they were a little bit different, right?

00:15:59.540 --> 00:16:04.020
Like I did a class for the people that ran the launch control for NASA.

00:16:04.020 --> 00:16:06.900
I think they were technically Air Force, but still, that was pretty cool.

00:16:06.900 --> 00:16:08.640
And someone at Edwards Air Force Base.

00:16:08.640 --> 00:16:11.740
And I talked about like, oh, yeah, you just pip install this thing.

00:16:11.740 --> 00:16:14.700
And you get like, look at this amazing package that are like, that's really awesome.

00:16:14.700 --> 00:16:17.540
We're never, ever going to be able to do that.

00:16:17.540 --> 00:16:19.580
You can't just install stuff off the internet.

00:16:19.580 --> 00:16:22.780
So tell us what programming in this world feels like.

00:16:22.780 --> 00:16:27.040
So that's the tough part, right?

00:16:27.220 --> 00:16:31.280
Is anyone listening to this show probably knows what Python's capable of.

00:16:31.280 --> 00:16:33.340
And we're all here because we love it, right?

00:16:33.340 --> 00:16:34.500
It's a great language.

00:16:34.500 --> 00:16:38.220
And then there's the government limitations that you just got to.

00:16:38.220 --> 00:16:42.300
So there's a group in the Pentagon called N81 that doesn't really mean anything.

00:16:42.300 --> 00:16:44.560
But they're kind of some of our researchers on the Navy side.

00:16:44.560 --> 00:16:47.520
And a lot of ops research guys and a lot of coders.

00:16:47.520 --> 00:16:52.460
We do in some cases have standalone machines that are able to touch the outside world.

00:16:52.460 --> 00:16:56.720
But they're just not plugged into like our broader, just unclassified internet,

00:16:56.900 --> 00:16:59.580
which is called NMCI for Navy Marine Corps internet.

00:16:59.580 --> 00:17:04.960
Now, some of those N81 folk allegedly treading a little bit of dangerous water, maybe,

00:17:04.960 --> 00:17:10.340
maybe found a way to kind of get Python working on their machines, but to try to do work.

00:17:10.340 --> 00:17:13.560
But again, what you got to a truth, which is, oh, you go, you need some package.

00:17:13.560 --> 00:17:15.220
You can't just pip install it.

00:17:15.460 --> 00:17:21.880
Again, allegedly, it might be the case that you have to download the wheel.whl files.

00:17:21.880 --> 00:17:22.940
Whl, yeah.

00:17:22.940 --> 00:17:23.420
Yeah, yeah.

00:17:23.420 --> 00:17:24.920
You have to download the wheel files.

00:17:24.920 --> 00:17:25.780
I call them wheel files.

00:17:25.780 --> 00:17:26.740
I don't actually know what the...

00:17:26.740 --> 00:17:27.040
Yeah, yeah.

00:17:27.040 --> 00:17:27.740
Yeah.

00:17:27.740 --> 00:17:30.040
Yeah, you have to download those manually and install them.

00:17:30.040 --> 00:17:36.160
But of course, if one package needs like subservient packages, you have to like backtrack, right?

00:17:36.160 --> 00:17:39.480
Until you have what you need to then get Python running.

00:17:39.480 --> 00:17:53.940
But even if you go through that heartache, you now are facing another conundrum, which is you have Python running, yay, on your government computer, which because we're so big and we try to standardize everything.

00:17:53.940 --> 00:18:01.060
And for good reason, there's a lot of background processes running to keep machines up to date and to monitor activity and such.

00:18:01.440 --> 00:18:12.960
A core i5 with 8 gigs of RAM that is, you know, permanently got 80% of that used isn't exactly the like analytical monster you might want.

00:18:12.960 --> 00:18:13.980
Right, right.

00:18:13.980 --> 00:18:14.620
And so...

00:18:14.620 --> 00:18:20.100
And it's trying to decrypt the drive and run the three different virus scanners and then the network monitor.

00:18:20.100 --> 00:18:23.720
It's like at a permanent 60% CV usage before you touch it, right?

00:18:23.720 --> 00:18:24.720
Yeah, exactly.

00:18:24.720 --> 00:18:25.840
You know too well.

00:18:25.840 --> 00:18:30.740
So that's the hard part is someone like me, I'm always beating the drum.

00:18:30.860 --> 00:18:39.360
My last boss when I was a commanding officer probably got tired of me beating the drum about, you know, if we can improve the technology that our sailors have, we'll be so much more efficient.

00:18:39.360 --> 00:18:40.000
Yeah.

00:18:40.000 --> 00:18:41.720
And that's one of our limitations.

00:18:41.720 --> 00:18:44.780
And I understand and get the complexities of that problem.

00:18:44.780 --> 00:18:45.600
It's not easy.

00:18:45.600 --> 00:18:48.580
It's not, oh, you just got hired with insert tech company here.

00:18:48.580 --> 00:18:49.380
Here's your new MacBook.

00:18:49.380 --> 00:18:51.020
You can't do that with us.

00:18:51.020 --> 00:18:51.800
Yeah, exactly.

00:18:51.800 --> 00:18:54.600
But that's sort of the challenge.

00:18:54.600 --> 00:18:58.640
Now, what's sort of interesting is COVID has changed a lot of that.

00:18:59.320 --> 00:19:05.260
It's changed it for, I think, for banks and for all sorts of industries that were like, we can't work from home.

00:19:05.260 --> 00:19:06.580
You can't access this from your home.

00:19:06.580 --> 00:19:09.820
But you guys are kind of the far end of that spectrum.

00:19:09.820 --> 00:19:11.580
Well, yes, comma.

00:19:11.800 --> 00:19:23.200
I've actually been working from home for six months, which has allowed me to, with data that is not sensitive, obviously, the main thing that I would be dealing with would be personally identifiable information.

00:19:23.200 --> 00:19:24.220
Now, that's on my machine.

00:19:24.440 --> 00:19:26.140
I keep a good delineation.

00:19:26.140 --> 00:19:30.380
But a lot, the main data sources I tend to work with don't have that anyway.

00:19:30.640 --> 00:19:34.820
So I've been able to move a lot of my analytical work to my personal computer, which I'm a nerd.

00:19:34.820 --> 00:19:35.860
It's a good machine, right?

00:19:35.860 --> 00:19:52.000
So that has sort of supercharged me with what I've been able to do as an analyst in this work from home environment, which has, at least in my case, but I can just kind of sense that across the broader structure of the military, the higher ups are realizing, oh, wow.

00:19:52.080 --> 00:19:56.460
Our people are more effective in a lot of cases, and they're happier?

00:19:56.460 --> 00:19:56.860
What?

00:19:56.860 --> 00:19:57.260
You know?

00:19:57.260 --> 00:19:58.440
Yeah, exactly.

00:19:58.440 --> 00:19:59.000
Wait a minute.

00:19:59.000 --> 00:20:03.080
And we have this big fancy building we can go to, but they don't want to go to it anymore.

00:20:03.080 --> 00:20:05.540
Like, it's, yeah, it's a really interesting paradox.

00:20:05.540 --> 00:20:11.540
And what's silly about that is, for anyone listening out there that's doing data work, I work in a secure space.

00:20:11.540 --> 00:20:13.520
So I can't have my cell phone.

00:20:13.520 --> 00:20:15.780
And I'm not missing it because I want to play a game.

00:20:15.780 --> 00:20:17.460
I can't have a podcast going.

00:20:17.460 --> 00:20:17.860
Yeah.

00:20:17.860 --> 00:20:20.040
I can't have music going, right?

00:20:20.040 --> 00:20:29.380
And just that change alone, just to put on something when I got to really focus on a data problem and just get some kind of good techno trance going, if you will, in the classic coder.

00:20:29.380 --> 00:20:32.000
Yeah, just have the distractions, right?

00:20:32.000 --> 00:20:32.860
Yeah, it helps.

00:20:32.860 --> 00:20:35.280
So COVID's changed a lot of that for us.

00:20:35.280 --> 00:20:38.880
And I can just tell, I think, like the whole world at large, we're just a microcosm of it.

00:20:38.880 --> 00:20:41.980
We're never going to go back to normal, whatever that was.

00:20:41.980 --> 00:20:42.320
Yeah.

00:20:42.320 --> 00:20:43.680
We're permanently going to be.

00:20:43.680 --> 00:20:49.020
So what about, like, things that allow whitelisted packages?

00:20:49.020 --> 00:20:55.660
To be vetted and then like local PyPI server type of things.

00:20:55.660 --> 00:20:59.000
Is that something you guys have looked at or maybe you will be looking at?

00:20:59.000 --> 00:21:01.460
Yeah, there is some of that happening.

00:21:01.460 --> 00:21:03.820
So government is headed in that direction.

00:21:03.820 --> 00:21:05.600
The senior people, they get it.

00:21:05.600 --> 00:21:07.880
I mean, it isn't like they don't know, right?

00:21:07.880 --> 00:21:08.240
Yeah.

00:21:08.360 --> 00:21:18.740
And they can recognize that we, from my point of view anyway, maybe a little bit behind, just a little bit behind our civilian peers and know they need to bring that stuff online.

00:21:18.740 --> 00:21:20.020
And we're starting to develop some of that.

00:21:20.020 --> 00:21:26.820
I know some of my counterparts in my office, you know, working for the Admiral of the Navy Reserve, they're helping.

00:21:27.000 --> 00:21:36.340
They're involved with the process to develop what we're calling the authoritative data environment, which is going to be sort of a, what's the name for when you have like a kind of a machine and a machine?

00:21:36.340 --> 00:21:37.520
I'm blanking right now.

00:21:37.520 --> 00:21:38.500
Like a virtual machine?

00:21:38.500 --> 00:21:39.520
Yeah, yeah, a virtual machine.

00:21:39.520 --> 00:21:40.480
I was just blanking.

00:21:40.480 --> 00:21:43.320
It's basically a virtual environment that you can like remote into.

00:21:43.520 --> 00:21:46.120
And then you're going to have the full suite of packages.

00:21:46.120 --> 00:21:52.140
And presumably someone would have white listed all the Python packages you could want, right?

00:21:52.140 --> 00:21:53.720
So we're trying to get there.

00:21:53.720 --> 00:22:02.120
It's just, we got to get there while navigating the limitations of our government requirements, which, you know, many of which are in congressional law, right?

00:22:02.120 --> 00:22:04.600
So it's not like that's an easy thing to change and update.

00:22:04.600 --> 00:22:06.800
It's not like there's just a picky manager.

00:22:06.800 --> 00:22:08.500
No, no, no, no, no, no.

00:22:08.500 --> 00:22:10.600
So that's where we're headed.

00:22:10.980 --> 00:22:14.400
So another thing, I don't want to go too far down the strad hole, but it is interesting to me.

00:22:14.400 --> 00:22:15.580
So let me ask another question.

00:22:15.580 --> 00:22:33.360
So have you guys looked at things like VS Code has the ability to just like run in the browser and execute code and say like a Docker environment in Azure or other places where if you just have access to the internet, you basically have unbounded compute.

00:22:33.360 --> 00:22:39.840
Have you looked at those types of setups or even creating like isolated something like that internally, but then setting up those kinds of servers?

00:22:40.400 --> 00:22:41.440
There is something like that.

00:22:41.440 --> 00:22:43.740
And it actually shows you how much in demand it would be.

00:22:43.740 --> 00:22:45.940
When that initially got set up, I'm blanking on the name.

00:22:45.940 --> 00:22:47.400
I haven't tried to use it for almost a year.

00:22:47.400 --> 00:22:48.540
The demand.

00:22:48.540 --> 00:22:50.520
It was overwhelmed and just killed it.

00:22:50.520 --> 00:22:51.860
Yeah.

00:22:51.860 --> 00:22:52.560
Yeah.

00:22:52.560 --> 00:22:55.180
Demand from people like me was so significant.

00:22:55.180 --> 00:22:57.380
It just vomited and died.

00:22:57.960 --> 00:23:00.020
And it was really hard to use.

00:23:00.020 --> 00:23:06.540
And then the other problem is we don't exactly have the fastest pipe up and down to do work like that.

00:23:06.540 --> 00:23:11.760
So you're going to be working in a high latency environment oftentimes, which can make the experience more challenging.

00:23:11.760 --> 00:23:13.080
But there are setups.

00:23:13.080 --> 00:23:15.160
I know the Air Force has one that's pretty robust.

00:23:15.440 --> 00:23:15.580
Okay.

00:23:15.580 --> 00:23:22.500
I think that's kind of ironic given that our ARPANET and DARPA and all that stuff sort of created the internet.

00:23:22.500 --> 00:23:23.160
Yeah, right.

00:23:23.160 --> 00:23:25.980
And I know people hear I'm in the Pentagon.

00:23:25.980 --> 00:23:29.160
They picture some kind of like Jason Bourne control room.

00:23:29.160 --> 00:23:29.700
Right.

00:23:29.900 --> 00:23:31.540
And those places exist in the Pentagon.

00:23:31.540 --> 00:23:32.740
I'm not in it.

00:23:32.740 --> 00:23:33.160
Yeah.

00:23:33.160 --> 00:23:33.760
But.

00:23:33.760 --> 00:23:34.520
Exactly.

00:23:34.520 --> 00:23:34.940
Yeah.

00:23:34.940 --> 00:23:35.280
Yeah.

00:23:35.280 --> 00:23:35.460
Cool.

00:23:35.460 --> 00:23:35.940
All right.

00:23:35.940 --> 00:23:48.240
So another thing I want to kind of touch on is you wrote an interesting article that actually touched on an episode with Jacqueline and Emily about the different branches or pot.

00:23:48.240 --> 00:23:57.140
Like when you say I'm a data scientist or I have a career in data science or data engineering, like that actually can mean a whole bunch of different stuff and really interesting ways to kind of map out that world.

00:23:57.140 --> 00:23:58.760
You want to talk about that just a little bit?

00:23:58.760 --> 00:23:59.240
Sure.

00:23:59.240 --> 00:23:59.460
Yeah.

00:23:59.480 --> 00:24:01.020
I mean, I have a blog that's for me.

00:24:01.020 --> 00:24:01.620
I don't.

00:24:01.620 --> 00:24:05.380
I haven't even done like good SEO on it for that matter.

00:24:05.380 --> 00:24:08.560
But that episode was 262 with Jacqueline and Emily.

00:24:08.560 --> 00:24:11.300
You know, they described different kind of fictitious companies.

00:24:11.300 --> 00:24:15.340
And one of them, when they got to this is a large company, probably a lot of government contracting.

00:24:15.340 --> 00:24:16.160
Maybe it is government.

00:24:16.160 --> 00:24:17.560
You know, my ears perk up.

00:24:17.560 --> 00:24:17.820
Right.

00:24:17.820 --> 00:24:18.580
Maybe it's Boeing.

00:24:18.580 --> 00:24:19.520
Maybe it's even the Pentagon.

00:24:19.520 --> 00:24:20.100
Okay.

00:24:20.100 --> 00:24:20.480
Right.

00:24:20.480 --> 00:24:27.320
And then they perfectly describe some of these challenges we just discussed, which is, wow, you don't have access to the tools you want.

00:24:27.380 --> 00:24:30.660
But then they really go down the analyst role, which is certainly what I consider myself.

00:24:30.660 --> 00:24:32.060
I'm technically trained.

00:24:32.060 --> 00:24:33.520
I have technical skills.

00:24:33.520 --> 00:24:38.740
But especially at my level, they were so eloquent in how they described it.

00:24:39.180 --> 00:24:47.180
I'm the one who, almost by virtue of my education, when I speak to numbers, it's gospel, if you will.

00:24:47.180 --> 00:24:48.840
And then that's an important trust, right?

00:24:48.840 --> 00:24:50.460
My admiral trusts me that I'm right.

00:24:50.460 --> 00:24:52.420
And I can never betray that.

00:24:52.460 --> 00:25:04.420
So I'm the one that's kind of in the boardroom, if you will, showing the CEO the charts and breaking down what's what for them, as opposed to the real data engineer in the trenches.

00:25:04.420 --> 00:25:05.020
Right.

00:25:05.020 --> 00:25:10.640
Like deploying a machine learning model to production over like a FastAPI implementation, right?

00:25:10.640 --> 00:25:11.540
Not so much that.

00:25:11.740 --> 00:25:12.760
No, no, no, not at all.

00:25:12.760 --> 00:25:15.420
I have done some technical stuff with Python in my current role.

00:25:15.420 --> 00:25:16.720
And we can talk about that.

00:25:16.720 --> 00:25:21.480
But I am more of the, and Jacqueline and Emily talk a lot about, I think they say Excel and PowerPoint.

00:25:21.480 --> 00:25:23.820
I'm like, haha, yeah, that's my life.

00:25:23.820 --> 00:25:30.440
My PowerPoint skills have become much stronger in the last year of this job than my coding skills.

00:25:30.600 --> 00:25:33.580
That is the lingua franca of that whole environment, isn't it?

00:25:33.580 --> 00:25:34.300
Yep, absolutely.

00:25:34.300 --> 00:25:43.500
I legitimately was joking with my other data buddy, just about what a PowerPoint savant I've become, almost to the point that, like, it's like, oh, you want your slides touched up?

00:25:43.500 --> 00:25:44.160
Contact Clark.

00:25:44.160 --> 00:25:46.140
So that's a feather.

00:25:46.140 --> 00:25:52.920
I remember doing a training course with this group out of the Air Force Academy in Colorado Springs.

00:25:53.820 --> 00:26:01.620
And, like, one of the pinnacle moments was when we found a way to dynamically generate one of the slides in PowerPoint.

00:26:01.620 --> 00:26:05.820
It was like, it would pull in data from where all the planes were flying.

00:26:05.820 --> 00:26:11.740
And it would dynamically, like, in real time or, like, near real time update what would be shown in the PowerPoint.

00:26:11.740 --> 00:26:13.960
It wasn't, like, enough to have that on a web page.

00:26:13.960 --> 00:26:18.060
It was like, it needs to generate a slide on live data.

00:26:18.060 --> 00:26:19.660
Like, why would you do that?

00:26:19.660 --> 00:26:20.960
Like, it doesn't matter why.

00:26:21.040 --> 00:26:24.160
It has to do this because this is the world we're in, right?

00:26:24.160 --> 00:26:25.020
Yep.

00:26:25.020 --> 00:26:27.780
We are beholding the PowerPoint for sure.

00:26:27.780 --> 00:26:31.620
You know, it's funny we talk about PowerPoint because Tableau is starting to gain traction.

00:26:31.620 --> 00:26:34.300
People are realizing the power of a good Tableau dashboard.

00:26:34.300 --> 00:26:40.840
And that has, if nothing else, the name Tableau, like, is spoken in whispers in the halls of the Pentagon.

00:26:40.840 --> 00:26:43.080
So, you know, maybe we'll get there eventually.

00:26:43.080 --> 00:26:44.600
Yeah, that's a bit of a step up.

00:26:44.600 --> 00:26:45.540
That's a bit of a step up.

00:26:45.540 --> 00:26:45.800
Yep.

00:26:45.800 --> 00:26:50.940
But, yeah, anyone who has not listened to episode 262, and I'll link to it, Jacqueline and Emily wrote a,

00:26:50.940 --> 00:26:52.140
really good book.

00:26:52.140 --> 00:26:55.520
Like, I'm not even that interested in a data science career for myself.

00:26:55.520 --> 00:26:57.200
And I'm like, this is like a page turner.

00:26:57.200 --> 00:27:00.420
This is really, I think they really broke it down well.

00:27:00.420 --> 00:27:03.680
And it, because people ask me, like, oh, I want to get into data science.

00:27:03.680 --> 00:27:04.380
What should I do?

00:27:04.380 --> 00:27:05.080
What should I study?

00:27:05.080 --> 00:27:06.740
I'm like, that's not enough.

00:27:06.740 --> 00:27:10.980
I don't know enough to answer your question necessarily, because that means kind of different things.

00:27:10.980 --> 00:27:12.520
So, I recommend people check that out.

00:27:12.520 --> 00:27:13.080
It's a good one.

00:27:13.080 --> 00:27:13.840
Yeah, definitely.

00:27:13.840 --> 00:27:16.720
I mean, for me, that episode gave me, like, validity.

00:27:16.720 --> 00:27:18.580
I'm kind of the king of imposter syndrome.

00:27:18.580 --> 00:27:19.580
And I heard that.

00:27:19.580 --> 00:27:25.080
I was like, oh, like, they describe a legitimate, valuable role that I'm kind of well-suited to.

00:27:25.080 --> 00:27:26.240
Sweet.

00:27:26.240 --> 00:27:27.360
You know?

00:27:27.360 --> 00:27:27.860
That's awesome.

00:27:27.860 --> 00:27:28.680
That's all right.

00:27:28.680 --> 00:27:33.240
Well, because you might compare yourself against, like, the machine learning people deploying

00:27:33.240 --> 00:27:34.680
machine learning models at Google.

00:27:34.680 --> 00:27:36.100
You're like, well, I can't do any of that.

00:27:36.100 --> 00:27:37.600
Like, all of that is foreign to me, right?

00:27:37.600 --> 00:27:40.380
But that doesn't mean you're not doing valid data science.

00:27:40.540 --> 00:27:42.680
Like, you're just doing, like, a different slice of it.

00:27:42.680 --> 00:27:43.360
Yeah, absolutely.

00:27:43.360 --> 00:27:48.520
And it's important to have someone that can speak to it and translate it into the common

00:27:48.520 --> 00:27:49.540
vernacular, if you will.

00:27:49.540 --> 00:27:51.860
And I think that's kind of where I've found myself.

00:27:51.860 --> 00:27:52.120
Yeah.

00:27:52.120 --> 00:27:56.960
And hearing them talk about that gave me hope, because whenever I retire from the service in

00:27:56.960 --> 00:28:00.120
a couple of years, potentially, like, okay, cool.

00:28:00.120 --> 00:28:01.460
There are roles in the outside world.

00:28:01.460 --> 00:28:04.180
Some kind of weird military Stockholm syndrome.

00:28:04.180 --> 00:28:05.780
I know that there are.

00:28:05.780 --> 00:28:06.820
Yeah.

00:28:06.820 --> 00:28:10.880
I suspect that a lot of the stuff that you work on, you can't really share or talk about

00:28:10.880 --> 00:28:11.280
a bunch.

00:28:11.280 --> 00:28:15.360
And so it doesn't give you that chance to kind of put it side by side with other people.

00:28:15.360 --> 00:28:21.920
Let's talk about your thesis and this optimization stuff for the Python library, Pyomo.

00:28:21.920 --> 00:28:22.420
Sure.

00:28:22.420 --> 00:28:25.920
So you said you did your work at Los Alamos National Labs.

00:28:25.920 --> 00:28:26.320
Is that right?

00:28:26.320 --> 00:28:26.720
Yeah.

00:28:26.720 --> 00:28:28.460
So I can back that up a little bit.

00:28:28.460 --> 00:28:33.600
Professor David Alderson, who's one of my thesis advisors, he's the head of the postgraduate

00:28:33.600 --> 00:28:36.400
schools, Center for Infrastructure Defense.

00:28:36.400 --> 00:28:38.140
I want to make sure.

00:28:38.140 --> 00:28:38.840
Yeah.

00:28:38.840 --> 00:28:40.160
Center for Infrastructure Defense.

00:28:40.160 --> 00:28:45.680
Making sure that the power grid doesn't go down and that the internet stays on and things

00:28:45.680 --> 00:28:46.020
like that.

00:28:46.020 --> 00:28:47.100
Yeah, absolutely.

00:28:47.100 --> 00:28:49.260
It's a power, water.

00:28:49.260 --> 00:28:50.600
And then that goes two ways, right?

00:28:50.600 --> 00:28:55.200
From a military context, it's about protecting our stuff in a potential theater of war, whether

00:28:55.200 --> 00:29:00.160
we're setting up a forward operating base in theater, as we would say, or domestically.

00:29:00.160 --> 00:29:04.940
But at the same time, if we know how to protect our stuff and are smart on that, we also know

00:29:04.940 --> 00:29:06.840
how to take out the enemy stuff better.

00:29:06.840 --> 00:29:07.300
Yeah.

00:29:07.300 --> 00:29:09.940
And so it works both ways from a military context.

00:29:09.940 --> 00:29:11.980
So he's the head of that center.

00:29:11.980 --> 00:29:17.120
And I got hooked up with him mainly because he taught one of the more advanced coding courses

00:29:17.120 --> 00:29:18.060
I took while I was there.

00:29:18.060 --> 00:29:20.520
And again, loving the language, coming back to how we started.

00:29:20.520 --> 00:29:26.220
And he was working in conjunction with researchers at Los Alamos National Labs, which is how I got

00:29:26.220 --> 00:29:26.840
hooked up with them.

00:29:26.840 --> 00:29:27.260
Okay.

00:29:27.480 --> 00:29:29.100
So which was a good opportunity.

00:29:29.100 --> 00:29:33.000
I got sent out there for several weeks to just be in that environment, learn, and kind

00:29:33.000 --> 00:29:37.220
of get hands-on with some other data, which I was able to bring back for my thesis, which

00:29:37.220 --> 00:29:39.240
then Paloma became kind of the cornerstone of it.

00:29:39.240 --> 00:29:39.620
Yeah.

00:29:39.620 --> 00:29:40.600
What was your thesis about?

00:29:40.600 --> 00:29:40.960
Yeah.

00:29:40.960 --> 00:29:44.660
So it was assessing the operational resilience of electrical distribution systems.

00:29:44.660 --> 00:29:45.500
Yeah.

00:29:45.500 --> 00:29:46.020
Okay.

00:29:46.020 --> 00:29:51.200
At the time, anyway, transmission, you know, think the big power towers that you see when you're

00:29:51.200 --> 00:29:54.100
in the middle of a highway somewhere that's the transmission lines.

00:29:54.360 --> 00:29:55.780
Those are really well understood.

00:29:55.780 --> 00:29:58.280
The white and orange ones that are really high.

00:29:58.280 --> 00:29:58.940
Yeah.

00:29:58.940 --> 00:29:59.240
Yeah.

00:29:59.240 --> 00:29:59.880
Those ones, right?

00:29:59.880 --> 00:30:00.220
Okay.

00:30:00.220 --> 00:30:00.620
Yeah.

00:30:00.620 --> 00:30:03.740
Those are really well understood and modeled as we understood.

00:30:03.740 --> 00:30:08.120
But distribution, like what's in your neighborhood, what's in your town, wasn't.

00:30:08.120 --> 00:30:09.980
And obviously, distribution works great.

00:30:09.980 --> 00:30:10.720
Right.

00:30:10.980 --> 00:30:16.340
But from our awareness, no one had really built a model using real world data, taking

00:30:16.340 --> 00:30:21.420
into account all of the mathematics for three phase AC transmission.

00:30:21.420 --> 00:30:27.980
That's kind of where some of my nuclear engineering background helped because I was cursorily familiar

00:30:27.980 --> 00:30:28.640
with that stuff.

00:30:28.640 --> 00:30:29.180
Yeah.

00:30:29.180 --> 00:30:31.320
I mean, that's basically a power plant as well, right?

00:30:31.320 --> 00:30:31.660
Yeah.

00:30:31.660 --> 00:30:33.440
Power plant and all the distribution, right?

00:30:33.500 --> 00:30:37.140
So I was familiar with concepts like real and reactive power.

00:30:37.140 --> 00:30:40.560
No one had built a model that took in real world data.

00:30:40.560 --> 00:30:48.360
And what we could basically do is say, hey, if we take out this electrical pole or that transformer,

00:30:48.360 --> 00:30:50.800
what will unequivocally happen?

00:30:50.800 --> 00:30:53.900
Most analysis had been based.

00:30:54.100 --> 00:30:58.280
It was essentially data analysis and regressions where you look at a disaster that happened,

00:30:58.280 --> 00:31:00.900
maybe a tornado touchdown in Oklahoma, right?

00:31:00.900 --> 00:31:01.560
Okay.

00:31:01.560 --> 00:31:04.480
We know that the tornado did damage here, here, and here.

00:31:04.480 --> 00:31:05.260
Okay.

00:31:05.260 --> 00:31:06.720
We understand the results of that.

00:31:06.720 --> 00:31:10.340
Now we can apply those results and think we'll know what will happen somewhere else.

00:31:10.340 --> 00:31:14.300
But we built a model that will allow us to unequivocally state what would happen.

00:31:14.300 --> 00:31:14.640
Yeah.

00:31:14.640 --> 00:31:15.000
Okay.

00:31:15.000 --> 00:31:19.380
And so the optimization part of that was working with the distribution system.

00:31:20.200 --> 00:31:26.900
We kind of made an assumption, if you will, that we want to minimize how much load, real

00:31:26.900 --> 00:31:32.540
and reactive power load, is lost if you take out a telephone pole or something, right?

00:31:32.540 --> 00:31:37.160
So in the end, the grid wants to keep power going everywhere the power is being asked for.

00:31:37.160 --> 00:31:42.900
So what we're trying to do is minimize the amount of power lost when you essentially mess with

00:31:42.900 --> 00:31:43.380
the network.

00:31:43.380 --> 00:31:44.220
Right.

00:31:44.220 --> 00:31:44.740
Okay.

00:31:44.740 --> 00:31:46.340
I grew up in Kansas City.

00:31:46.340 --> 00:31:48.900
Tornado Alley is sometime called.

00:31:48.900 --> 00:31:54.900
We ran experiments like that all the time of what happens if we take out this block of

00:31:54.900 --> 00:31:55.820
thing or whatever.

00:31:55.820 --> 00:31:58.240
But yeah, not in that clear sense, right?

00:31:58.240 --> 00:32:03.420
Like stuff would just get blown over and see the little capacitors, whatever, it's explode,

00:32:03.420 --> 00:32:07.440
whatever those gray cylindrical things that are on the towers.

00:32:07.440 --> 00:32:08.100
Yeah.

00:32:08.100 --> 00:32:08.820
Or the poles.

00:32:08.820 --> 00:32:09.580
Yeah.

00:32:09.580 --> 00:32:09.940
All right.

00:32:09.940 --> 00:32:12.580
So use this library, Pyomo.

00:32:12.580 --> 00:32:13.480
Tell us about that.

00:32:13.720 --> 00:32:13.860
Yeah.

00:32:13.860 --> 00:32:18.540
So what the library does, like we talked about at the beginning, I can't talk to what's

00:32:18.540 --> 00:32:19.700
happening behind the package.

00:32:19.700 --> 00:32:20.080
Sure.

00:32:20.180 --> 00:32:23.100
But it allows us to set up an optimization framework.

00:32:23.100 --> 00:32:24.180
As a consumer of it.

00:32:24.180 --> 00:32:24.400
Yeah.

00:32:24.400 --> 00:32:24.700
Yeah.

00:32:24.700 --> 00:32:25.580
I'm a consumer, right?

00:32:25.580 --> 00:32:32.280
So allows us to set up in Python and optimization framework to, I guess, structure these problems.

00:32:32.280 --> 00:32:34.100
So we're talking about an objective function.

00:32:34.100 --> 00:32:35.780
It can be a multi-objective function.

00:32:35.900 --> 00:32:42.100
And then the various constraints to perform linear or nonlinear optimization in whatever

00:32:42.100 --> 00:32:43.160
capacity you want to.

00:32:43.160 --> 00:32:46.320
So using everything that we love about Python, right?

00:32:46.320 --> 00:32:48.200
The relatively straightforward syntax.

00:32:48.200 --> 00:32:52.020
And then all the tools beyond that, which made it unique.

00:32:52.020 --> 00:32:56.080
We can set up these problems and then throw a solver at it.

00:32:56.080 --> 00:33:00.300
Like Cplex is what I used, which to me is a bit of a magic black box, though.

00:33:00.300 --> 00:33:03.940
We went into some of the mathematics behind that, obviously, like the simplex method and

00:33:03.940 --> 00:33:06.080
all the Danzig's work back in the 40s.

00:33:06.080 --> 00:33:11.200
But we throw a simplex at it and then structure in Python how we want our results.

00:33:11.200 --> 00:33:12.140
And voila.

00:33:12.140 --> 00:33:19.220
In the case of my thesis, we get a detailed printout, if you will, of what loads stayed up, what went

00:33:19.220 --> 00:33:19.540
down.

00:33:19.540 --> 00:33:21.900
And we can analyze that all within a Python framework.

00:33:21.900 --> 00:33:22.280
Yeah.

00:33:22.280 --> 00:33:22.900
That's beautiful.

00:33:22.900 --> 00:33:27.600
To give people a sense of this, let me maybe go through some of the problems that it solves.

00:33:27.600 --> 00:33:29.120
And then like some examples of using it.

00:33:29.120 --> 00:33:31.180
Then we'll go through a concrete code example.

00:33:31.180 --> 00:33:32.080
And that'll bring it together.

00:33:32.660 --> 00:33:36.160
So looking through their docs, some of the things you can do is linear programming.

00:33:36.160 --> 00:33:38.500
And I don't know how many people have done linear programming.

00:33:38.500 --> 00:33:39.920
It's really simple.

00:33:39.920 --> 00:33:43.840
It's not necessarily easy to compute, but it's not like a complicated thing.

00:33:43.840 --> 00:33:47.800
But it really, it's incredible the way that that like, this is the exact answer.

00:33:47.800 --> 00:33:48.860
Like all these constraints.

00:33:48.860 --> 00:33:49.880
Here's the optimization.

00:33:49.880 --> 00:33:52.600
I love it because it's simplicity plus power.

00:33:52.600 --> 00:33:53.060
Yeah.

00:33:53.060 --> 00:33:57.900
What we always talked about linear programming is guaranteed optimality, right?

00:33:57.900 --> 00:33:59.640
It's pretty straightforward.

00:33:59.800 --> 00:34:02.120
You don't have a local minimum or a local maximum.

00:34:02.120 --> 00:34:03.580
That's not the actual answer, right?

00:34:03.580 --> 00:34:03.900
Yeah.

00:34:03.900 --> 00:34:04.380
Yeah, exactly.

00:34:04.380 --> 00:34:09.120
And in some cases, especially with nonlinear problems, you can get stuck in a local minimum

00:34:09.120 --> 00:34:10.740
or maximum depending on where you're going.

00:34:10.740 --> 00:34:15.380
But generally speaking, if you write a greedy heuristic, you'll get a good answer.

00:34:15.380 --> 00:34:17.340
But is it optimal?

00:34:18.020 --> 00:34:18.200
Right.

00:34:18.200 --> 00:34:23.040
And that's the real sticking point that the professor's there because maybe this comes

00:34:23.040 --> 00:34:28.480
back to kind of that military background, but we often will not settle, especially in a war

00:34:28.480 --> 00:34:32.160
context, I suppose, for anything that's suboptimal, right?

00:34:32.160 --> 00:34:33.780
And that guaranteed optimality.

00:34:33.780 --> 00:34:36.040
And I know an example of FedEx, right?

00:34:36.040 --> 00:34:36.360
Right.

00:34:36.420 --> 00:34:41.340
They gobble up a lot of the ops research graduates out of the Naval Postgraduate School

00:34:41.340 --> 00:34:47.220
because their profit margins hinge on optimality with delivery, right?

00:34:47.220 --> 00:34:49.780
There's a traveling salesman problem for you, right?

00:34:49.780 --> 00:34:50.740
Yeah.

00:34:50.740 --> 00:34:51.680
Yeah.

00:34:51.680 --> 00:34:57.540
The whole UPS, FedEx delivery stuff, especially with COVID, it's like insane how many of those

00:34:57.540 --> 00:34:58.200
guys are driving around.

00:34:58.600 --> 00:35:02.280
So we've got linear programming, quadratic programming, nonlinear programming, what it

00:35:02.280 --> 00:35:03.180
gets really interesting.

00:35:03.180 --> 00:35:08.900
Let's see, stochastic stuff, just junctive programming, which I don't know anything about,

00:35:08.900 --> 00:35:14.240
but differential algebraic equations, equilibriums, all these different types of problems.

00:35:14.240 --> 00:35:14.960
It can solve those.

00:35:14.960 --> 00:35:18.820
And then some of the projects using it that they've listed on their site that I thought

00:35:18.820 --> 00:35:24.900
was interesting is the DISPA set, which is unit commitment and dispatch model focused on

00:35:24.900 --> 00:35:28.640
balancing and flexibility problems in European power grades.

00:35:28.640 --> 00:35:30.780
It seems like it comes back to power a lot, honestly.

00:35:30.780 --> 00:35:31.320
Yeah.

00:35:31.320 --> 00:35:34.680
I was actually surprised looking through these, seeing how many power problems there were,

00:35:34.680 --> 00:35:35.540
which I don't know.

00:35:35.540 --> 00:35:37.280
I would not have expected that, but yay.

00:35:37.280 --> 00:35:38.560
Yeah.

00:35:38.560 --> 00:35:39.720
I didn't either, but yeah, that's cool.

00:35:39.720 --> 00:35:42.380
There's another one, which I don't know how to pronounce.

00:35:42.380 --> 00:35:49.560
I-D-A-E-S-P-S-A, P-S-E toolkit, which is a open source optimization-based framework for

00:35:49.560 --> 00:35:52.300
chemical processes, which is pretty cool.

00:35:52.980 --> 00:35:56.700
MinPower, which is an open source toolkit for students and researchers and power systems.

00:35:56.700 --> 00:35:58.720
Open energy modeling framework.

00:35:58.720 --> 00:36:03.460
Like I said, it's a lot of energy in here, which is a open framework for developing energy

00:36:03.460 --> 00:36:07.060
models that emphasize communication and community involvement.

00:36:07.060 --> 00:36:12.920
And then OpenAgua, which is a web-based app for modeling water systems for water resource

00:36:12.920 --> 00:36:13.800
planning and management.

00:36:13.800 --> 00:36:17.200
So I think that gives people a sense of like some of the types of problems this is being

00:36:17.200 --> 00:36:17.780
applied to.

00:36:18.100 --> 00:36:18.160
Yeah.

00:36:18.160 --> 00:36:22.200
And I know those are kind of, those are obviously complex and real world.

00:36:22.200 --> 00:36:28.160
I know in a learning context, many of the classic computer science problems, traveling salesman,

00:36:28.160 --> 00:36:29.480
the knapsack problem.

00:36:29.480 --> 00:36:34.280
If you're familiar with that or for the audience's essay is basically, I have a bag that can hold

00:36:34.280 --> 00:36:35.400
20 units of stuff.

00:36:35.400 --> 00:36:38.700
And I have a hundred units worth of things I want.

00:36:38.700 --> 00:36:39.740
I would love to try to fit in it.

00:36:40.160 --> 00:36:42.520
How do I maximize my value by putting in the knapsack?

00:36:42.520 --> 00:36:47.760
We would structure problems like those in Pyamo while we were learning the package.

00:36:47.760 --> 00:36:48.280
Right.

00:36:48.280 --> 00:36:50.460
So some of those classic problems can be solved here.

00:36:50.460 --> 00:36:51.000
Yeah.

00:36:51.000 --> 00:36:51.480
Yeah.

00:36:51.480 --> 00:36:51.900
Cool.

00:36:51.900 --> 00:36:53.100
All right.

00:36:53.100 --> 00:36:56.640
So on the Pyamo website, they have this dietary problem.

00:36:56.640 --> 00:36:58.900
They have a bunch of examples of, here are some examples you said.

00:36:58.900 --> 00:37:00.140
Do you want to talk us through this?

00:37:00.140 --> 00:37:02.420
It's a little bit hard to talk about code over the air.

00:37:02.420 --> 00:37:06.500
So we'll just keep it kind of vague in general, but maybe talk us through this and people go,

00:37:06.500 --> 00:37:08.720
okay, I see what this does and how I might use it.

00:37:08.720 --> 00:37:09.080
Yeah.

00:37:09.080 --> 00:37:09.360
Yeah.

00:37:09.360 --> 00:37:13.540
This is a great example, especially, I don't want to spoil it, but it gets a funny result.

00:37:13.540 --> 00:37:18.460
So what this diet problem is trying to do, and this is a classic optimization problem,

00:37:18.460 --> 00:37:23.940
is you want to select, you have a group of foods and you want to select foods to meet your

00:37:23.940 --> 00:37:26.440
nutritional requirements at minimum cost.

00:37:26.440 --> 00:37:29.140
And I think nutritional means caloric.

00:37:29.140 --> 00:37:30.560
Yeah.

00:37:30.560 --> 00:37:32.740
Not necessarily all your vitamins.

00:37:32.740 --> 00:37:34.920
And I'm living on the food pyramid, right?

00:37:34.920 --> 00:37:36.720
Yeah.

00:37:36.720 --> 00:37:36.920
Yeah.

00:37:36.920 --> 00:37:38.660
It's a very simple, it's a toy problem, right?

00:37:38.700 --> 00:37:40.720
So it's going to be relatively simple.

00:37:40.720 --> 00:37:45.660
And any optimization problem that'll probably go into Piamo is going to have either the word

00:37:45.660 --> 00:37:47.000
minimize or maximize, right?

00:37:47.000 --> 00:37:51.680
So we're trying to meet certain constraints, these caloric requirements while minimizing cost.

00:37:51.680 --> 00:37:55.980
Although I am reading, sorry to cut you off, but it does say, and the amount of vitamins,

00:37:55.980 --> 00:37:57.900
minerals, fat, sodium, and cholesterol.

00:37:57.900 --> 00:37:59.540
So it's not just calories.

00:37:59.540 --> 00:38:00.980
So it's a little more nuanced.

00:38:00.980 --> 00:38:01.280
Okay.

00:38:01.280 --> 00:38:01.780
All right.

00:38:01.780 --> 00:38:02.020
Okay.

00:38:02.020 --> 00:38:02.280
Yeah.

00:38:02.280 --> 00:38:09.700
So what they do is they set up the mathematical formulation outside of code first, which is how you would do any good linear programming.

00:38:09.700 --> 00:38:11.320
And so you have a couple sets, right?

00:38:11.320 --> 00:38:13.060
You have a set of foods and a set of nutrients.

00:38:13.060 --> 00:38:17.040
And then they have a whole bunch of parameters that need to really read, I guess.

00:38:17.040 --> 00:38:22.760
But like the cost per serving of a given food, the amount of nutrient J and food I.

00:38:22.760 --> 00:38:25.120
So it's A sub IJ.

00:38:25.120 --> 00:38:27.460
And then you got minimum level of nutrients.

00:38:27.460 --> 00:38:28.000
Right.

00:38:28.000 --> 00:38:30.500
Like how much sodium, how much fat and so on.

00:38:30.500 --> 00:38:30.660
Yeah.

00:38:30.660 --> 00:38:31.120
Yep.

00:38:31.120 --> 00:38:31.400
Yep.

00:38:31.700 --> 00:38:34.020
The amount of the food, I guess, mass or volume.

00:38:34.020 --> 00:38:36.820
And then how much you can actually consume.

00:38:36.820 --> 00:38:37.540
Let's see here.

00:38:37.540 --> 00:38:38.120
What else have they got?

00:38:38.120 --> 00:38:39.240
This is great.

00:38:39.240 --> 00:38:43.200
The number of servings of food to consume.

00:38:43.200 --> 00:38:45.180
So how much are you eating of any given food, I guess.

00:38:45.180 --> 00:38:48.900
And then, so here's the meat and potatoes of any good LP.

00:38:48.900 --> 00:38:51.380
Either you're going to minimize the cost of the food.

00:38:51.380 --> 00:38:57.100
So you're minimizing the sum of 4i of the cost times how much you eat of different foods.

00:38:57.100 --> 00:38:57.900
Right.

00:38:57.980 --> 00:39:01.900
So i is the different foods and it's how much you eat of it times the cost of it.

00:39:01.900 --> 00:39:02.420
Right.

00:39:02.420 --> 00:39:07.420
So if you're eating $5 milkshakes and you eat two of them, right, you spent 10 bucks.

00:39:07.420 --> 00:39:07.700
Right.

00:39:07.700 --> 00:39:08.820
We're trying to minimize that cost.

00:39:08.820 --> 00:39:09.640
Yeah.

00:39:09.640 --> 00:39:12.100
And you've gotten however much goodness out of that.

00:39:12.100 --> 00:39:12.240
Yeah.

00:39:12.240 --> 00:39:13.480
But you're trying to minimize the price.

00:39:13.480 --> 00:39:15.460
So that would be 10 contribution there.

00:39:15.460 --> 00:39:15.860
Uh-huh.

00:39:15.860 --> 00:39:16.140
Okay.

00:39:16.140 --> 00:39:16.360
Go ahead.

00:39:16.360 --> 00:39:20.760
So then, but now to frame this, I don't know if this is a little abstract for the audience,

00:39:20.760 --> 00:39:24.400
but you can think of a lot of these problems in like a multidimensional framework.

00:39:24.840 --> 00:39:31.140
If you just have X and Y axes and going up and Y and to the right, if you will, and X is

00:39:31.140 --> 00:39:32.740
both the direction you want to go.

00:39:32.740 --> 00:39:36.740
Well, the optimal spot of those two constraints is the top right corner.

00:39:36.740 --> 00:39:37.260
Right.

00:39:37.260 --> 00:39:39.840
So I don't know if that made sense, but yeah.

00:39:39.840 --> 00:39:43.320
So for the constraints, you're going to limit the nutrient consumption for each one.

00:39:43.320 --> 00:39:45.740
So you have like a less than set up.

00:39:45.740 --> 00:39:47.880
You got to limit the amount of food consumed.

00:39:47.880 --> 00:39:50.920
Like you can't just eat like a hundred cheeseburgers and go, we're good.

00:39:50.920 --> 00:39:51.420
Yeah.

00:39:51.420 --> 00:39:51.820
We're good.

00:39:51.820 --> 00:39:52.040
Right.

00:39:52.040 --> 00:39:55.760
And then you have a maximum amount of food that I guess your stomach can hold that they

00:39:55.760 --> 00:39:56.980
have in here.

00:39:56.980 --> 00:39:57.220
Right.

00:39:57.220 --> 00:40:03.440
So you can only eat so much of the various foods less than or equal to the maximum amount you

00:40:03.440 --> 00:40:03.840
can eat.

00:40:03.840 --> 00:40:08.600
And then there's also, and this is important that you'll see this will get forgotten a lot

00:40:08.600 --> 00:40:13.060
because it's so stupid, but you have to have a lower bound with optimization problems.

00:40:13.060 --> 00:40:13.320
Right.

00:40:13.340 --> 00:40:16.940
So they, the amount of food you eat has to be greater than or equal to zero.

00:40:16.940 --> 00:40:17.540
Right.

00:40:17.540 --> 00:40:21.280
Cause if you don't have that in there, it'll be like, Oh, eat infinite negative food and

00:40:21.280 --> 00:40:21.760
you're great.

00:40:21.760 --> 00:40:22.000
Right.

00:40:22.000 --> 00:40:22.580
It's free.

00:40:22.580 --> 00:40:24.280
You can't eat negative milkshakes.

00:40:24.280 --> 00:40:24.720
Right.

00:40:24.720 --> 00:40:25.140
So.

00:40:25.140 --> 00:40:25.780
Exactly.

00:40:25.780 --> 00:40:26.700
You get paid to eat it.

00:40:26.700 --> 00:40:30.320
So that's sort of the LP setup that they have on this site.

00:40:30.320 --> 00:40:35.800
And then they go into the actual pie on formulation where they were always this, they import it.

00:40:35.800 --> 00:40:40.360
And then you'll see if someone were to look at this link in the show notes, they, they

00:40:40.360 --> 00:40:41.840
define it as an abstract model.

00:40:41.840 --> 00:40:44.080
You can do a concrete model, an abstract model.

00:40:44.080 --> 00:40:46.380
I'm actually not a little embarrassing.

00:40:46.380 --> 00:40:48.620
My, my thesis was concrete.

00:40:48.620 --> 00:40:55.460
I'm not super informed on what the difference is between those, but we can move along, I suppose.

00:40:55.460 --> 00:40:59.300
And then they just, in their code, they, we define those things.

00:40:59.300 --> 00:41:00.620
We had the set of food, right?

00:41:00.620 --> 00:41:01.140
That was F.

00:41:01.140 --> 00:41:05.440
And so they're going to have, there's an object in Pyamo called model, right?

00:41:05.540 --> 00:41:08.300
So model.f is a set.

00:41:08.300 --> 00:41:13.040
They set it equal to a set and model.n is the nutrient set.

00:41:13.040 --> 00:41:14.460
So model.n equals a set, right?

00:41:14.460 --> 00:41:19.540
And those are just, now those are objects in Pyamo's framework in Python that now just

00:41:19.540 --> 00:41:22.380
exist for the purpose of these optimization problems.

00:41:22.380 --> 00:41:23.460
I've been talking a lot.

00:41:23.460 --> 00:41:24.120
You want to run with this?

00:41:24.120 --> 00:41:24.460
I don't know.

00:41:24.460 --> 00:41:25.200
No, no, go ahead.

00:41:25.200 --> 00:41:26.460
Like, you know this better than I do.

00:41:26.460 --> 00:41:28.000
So we're getting close to the end.

00:41:28.000 --> 00:41:29.320
That's actually not a whole lot more to it.

00:41:29.320 --> 00:41:29.720
Yeah.

00:41:29.720 --> 00:41:31.020
And then we're going to get to the fun part at the end.

00:41:31.020 --> 00:41:33.880
So then they have to define the cost of each food, right?

00:41:33.900 --> 00:41:39.600
And this is, as a small aside, this was great about doing this in Python is that you can,

00:41:39.600 --> 00:41:43.060
we all know how well Python works with data, right?

00:41:43.060 --> 00:41:48.260
So half of my thesis code was just taking the real world electrical grid data that we had

00:41:48.260 --> 00:41:51.880
and getting it shaped for use, right?

00:41:51.920 --> 00:42:00.380
So they do something similar here where they are looking at the data they have and feeding it in for each food, right?

00:42:00.380 --> 00:42:05.300
And then you got to keep track of how much of the stuff you're eating and they have some more code in there.

00:42:05.300 --> 00:42:05.780
Yeah.

00:42:05.780 --> 00:42:07.880
So you like, you've got this param object.

00:42:07.880 --> 00:42:13.920
You say the parameters come out of this, the food set or the nutrition set, the nutrient set.

00:42:13.980 --> 00:42:18.400
And then here's, these are positive reels or these are non-negative reels or these are integers.

00:42:18.400 --> 00:42:21.340
They can go up to infinity or whatever, right?

00:42:21.340 --> 00:42:21.820
Yep.

00:42:21.820 --> 00:42:22.080
Yeah.

00:42:22.080 --> 00:42:22.900
Thanks for bringing that up.

00:42:22.900 --> 00:42:23.480
So yeah.

00:42:23.480 --> 00:42:24.680
So you kind of just lay that out really.

00:42:24.680 --> 00:42:25.900
I think it's pretty straightforward.

00:42:25.900 --> 00:42:26.220
It's good.

00:42:26.220 --> 00:42:27.140
These are the constraints.

00:42:27.140 --> 00:42:27.660
Yep.

00:42:27.740 --> 00:42:29.080
And you have these, bam.

00:42:29.080 --> 00:42:34.740
And now, now the model from a mathematical perspective understands what those are, right?

00:42:34.740 --> 00:42:44.400
And then the exciting part is they get to where they define the objective function, which as we described is how much does the food cost times how much of that food you eat for a given food.

00:42:44.400 --> 00:42:46.740
And then minimizing that.

00:42:46.740 --> 00:42:49.020
So they set that up.

00:42:49.020 --> 00:42:57.300
And then the same constraints that we discussed a couple minutes ago about, again, the lower bound, not going below zero, the nutrient consumption for each food.

00:42:57.300 --> 00:43:03.380
They set up those constraints again in this, their functions that they set up and then pass these.

00:43:03.380 --> 00:43:11.520
You will usually in Pyamo, you'll write the function just as you would essentially any other Python function, passing it some of the elements of your model.

00:43:12.000 --> 00:43:22.060
And then you'll, once you have that function written, you will then pass that to a model dot, whatever you want to name it.

00:43:22.060 --> 00:43:26.080
And the function contains the constraint.

00:43:26.080 --> 00:43:36.820
And now passing that to the model dot, whatever your name is, will give that Pyamo object the inherent mathematical rules of said constraint.

00:43:36.820 --> 00:43:37.400
Yeah.

00:43:37.400 --> 00:43:38.400
It's pretty neat.

00:43:38.880 --> 00:43:44.540
And I guess the last bit is there's also a data file, which looks a little bit like YAML.

00:43:44.540 --> 00:43:48.140
I don't think it's YAML at all, but it looks like that's kind of the visualization.

00:43:48.140 --> 00:43:53.580
It says, okay, we have cheeseburgers, ham sandwiches, fish sandwiches, chicken sandwiches, sausage biscuits.

00:43:53.580 --> 00:43:55.920
You're going to get some serious caloric intake from that.

00:43:55.920 --> 00:44:01.980
And then, you know, like how much you're allowed to eat, how much protein you need, how much carbohydrates.

00:44:01.980 --> 00:44:05.760
And then it lays out like the ingredients for each one of those.

00:44:05.760 --> 00:44:11.960
So you just define this data file that says the parameter F has this options, the parameter N has these options and so on.

00:44:11.960 --> 00:44:12.560
Right.

00:44:12.560 --> 00:44:12.840
So.

00:44:12.840 --> 00:44:13.580
Yep.

00:44:13.580 --> 00:44:15.280
Put those two things together at the end.

00:44:15.280 --> 00:44:21.340
You say Pyamo solve, give it a solver, give it the Python code and the data file that has all these parameters.

00:44:21.340 --> 00:44:22.000
Yes.

00:44:22.300 --> 00:44:27.720
And it comes up with a beautiful solution in a, actually, I think an actual YAML file for the output.

00:44:27.720 --> 00:44:28.120
Yep.

00:44:28.120 --> 00:44:29.620
And then, so here's the funny part.

00:44:29.620 --> 00:44:30.540
So how should we eat?

00:44:30.540 --> 00:44:33.060
Like I'm looking to get a little healthier, but also save some money.

00:44:33.060 --> 00:44:33.580
So what do I do?

00:44:33.580 --> 00:44:33.840
Yeah.

00:44:33.840 --> 00:44:36.920
So, well, I got some great news for you, my friend.

00:44:36.920 --> 00:44:39.280
For only $15 a day.

00:44:39.280 --> 00:44:45.980
If you eat four cheeseburgers, only five French fries, one fish sandwich.

00:44:45.980 --> 00:44:47.360
Oh, five servings.

00:44:47.360 --> 00:44:47.580
Oh yeah.

00:44:47.580 --> 00:44:48.380
Five servings of French fries.

00:44:48.380 --> 00:44:49.920
Five servings of French fries, I believe.

00:44:49.920 --> 00:44:51.740
One fish sandwich and four milks.

00:44:51.740 --> 00:44:52.880
You're good.

00:44:52.880 --> 00:44:53.840
Boom.

00:44:53.840 --> 00:44:54.900
Yes.

00:44:54.900 --> 00:44:55.780
Yes.

00:44:56.660 --> 00:45:00.860
The only thing that would make me happier is if there was like an ice cream shake or two in there.

00:45:00.860 --> 00:45:07.900
What you got to do is you got to be sitting there eating that and just let people that walk by, just tell them that you're optimal.

00:45:07.900 --> 00:45:08.540
Exactly.

00:45:08.540 --> 00:45:10.900
I've solved it.

00:45:10.900 --> 00:45:12.820
I've solved the nutritional problem.

00:45:12.820 --> 00:45:13.160
Yeah.

00:45:13.160 --> 00:45:14.740
So I'll include this problem in the show notes.

00:45:14.740 --> 00:45:16.280
It's pretty interesting.

00:45:16.280 --> 00:45:17.660
It went really quick.

00:45:17.660 --> 00:45:19.920
It took 9.7 milliseconds to run this.

00:45:19.920 --> 00:45:21.360
So that's pretty quick.

00:45:21.360 --> 00:45:21.880
The best.

00:45:21.880 --> 00:45:26.460
And I mean, I can tell you, we had time parameters in my thesis and we're talking a pretty robust

00:45:26.460 --> 00:45:36.940
electrical system and some pretty high, high level mathematics to account for all of the three phase AC power flow constraints and everything there in for a lot from the electrical engineering perspective.

00:45:36.940 --> 00:45:37.220
Yeah.

00:45:37.220 --> 00:45:42.560
And I did all of it on a fairly middle of the road, like 2015 MacBook Pro.

00:45:42.560 --> 00:45:46.060
And it would knock it out in 20 seconds, maybe.

00:45:46.060 --> 00:45:46.480
Yeah.

00:45:46.480 --> 00:45:47.300
That's incredible.

00:45:47.300 --> 00:45:49.500
I thought, well, maybe I'll come back to this tomorrow.

00:45:49.500 --> 00:45:51.220
You know, I didn't know.

00:45:51.220 --> 00:45:52.960
Yeah.

00:45:52.960 --> 00:45:53.840
Yeah.

00:45:53.840 --> 00:45:55.220
Tell people it's going to take really long.

00:45:55.220 --> 00:45:56.140
I'll take the rest of the day off.

00:45:56.260 --> 00:45:56.660
Well, darn it.

00:45:56.660 --> 00:45:57.360
It's done already.

00:45:57.360 --> 00:45:57.940
Yeah.

00:45:57.940 --> 00:46:05.540
But that's the nice thing about it is when you structure, it's so abstract, it's hard to talk about like a podcast, I suppose.

00:46:05.540 --> 00:46:16.520
But when you structure the mathematics right, letting the solver work, that the solution is computationally, I suppose, not that intensive, I guess I would say.

00:46:16.520 --> 00:46:17.320
Yeah.

00:46:17.320 --> 00:46:19.920
As opposed to trying to enumerate the best solution.

00:46:19.920 --> 00:46:21.000
Right.

00:46:21.000 --> 00:46:21.400
Yeah.

00:46:21.400 --> 00:46:22.020
Yeah.

00:46:22.020 --> 00:46:23.840
But that's the computational savings.

00:46:23.840 --> 00:46:25.240
Exactly.

00:46:25.240 --> 00:46:32.640
You're taking an intelligent way to get to optimality as opposed to trying to do something and the sun would burn out before you'd finish, right?

00:46:32.640 --> 00:46:33.180
Right.

00:46:33.300 --> 00:46:35.480
Well, and it's a solver, right?

00:46:35.480 --> 00:46:38.080
It doesn't just like try every possible thing.

00:46:38.080 --> 00:46:40.880
It has algorithms and stuff and it's beautiful.

00:46:40.880 --> 00:46:41.220
Yeah.

00:46:41.320 --> 00:46:46.440
And the individuals that write these solvers, I mean, they're the mad scientists, right?

00:46:46.440 --> 00:46:47.780
That are able to.

00:46:47.780 --> 00:46:48.320
Yeah.

00:46:48.640 --> 00:46:52.460
You know, the solvers that actually blow my mind are the stochastic ones.

00:46:52.460 --> 00:46:55.740
I took some Stokes classes and it was just one of those like, okay.

00:46:55.740 --> 00:46:58.140
I don't really understand.

00:46:58.140 --> 00:46:59.500
I barely touched on it.

00:46:59.500 --> 00:47:06.720
I wasn't very much on the statistical side, but I did work with some people in my math experience around those.

00:47:06.720 --> 00:47:13.700
And it's like, here's a problem that'll take seven days to solve, or we can do this little magic and get basically the same answer in about half a second.

00:47:13.800 --> 00:47:16.740
Like, wait a minute, how did that even, how is this even possible?

00:47:16.740 --> 00:47:17.980
Like, what are these things doing?

00:47:17.980 --> 00:47:19.800
Well, I mean, that kind of comes back to what I said.

00:47:19.800 --> 00:47:29.500
I get a little naive with some of my education at times, but I want to say that in one of our first coding classes, we set up something like a traveling salesman problem.

00:47:29.500 --> 00:47:32.660
And I'm sitting there going, I got a Core i7 in here.

00:47:32.660 --> 00:47:34.020
This will knock this out.

00:47:34.020 --> 00:47:35.440
I start letting it go.

00:47:35.440 --> 00:47:41.180
And just to prove the point, the professor is like, literally, because we're doing it like brute force, basically.

00:47:41.460 --> 00:47:45.240
He's like, the sun will die before your computer will finish this problem.

00:47:45.240 --> 00:47:45.620
Yeah.

00:47:45.620 --> 00:47:49.680
You know, and then we structure it smartly in Piomo, and it takes a couple milliseconds.

00:47:49.680 --> 00:47:50.120
Yeah.

00:47:50.120 --> 00:47:51.000
It's insane.

00:47:51.000 --> 00:47:52.160
That's so insane.

00:47:52.160 --> 00:47:56.260
You also start to appreciate, like, factorial and stuff.

00:47:56.260 --> 00:47:57.120
Oh, yeah, right.

00:47:57.120 --> 00:48:01.080
What do you mean, the heat death of the universe before this time?

00:48:01.080 --> 00:48:01.640
This is no good.

00:48:01.640 --> 00:48:02.640
All right.

00:48:02.680 --> 00:48:04.360
Well, I think that gives people a sense.

00:48:04.360 --> 00:48:07.340
I mean, honestly, I don't recommend the diet.

00:48:07.340 --> 00:48:13.160
But it gives people a sense of the type of problems and the way you set them up.

00:48:13.160 --> 00:48:15.460
And it's a pretty clear, understandable problem.

00:48:15.460 --> 00:48:21.320
And then a simple bit of code, like the Python code that actually does the smarts, right?

00:48:21.320 --> 00:48:24.060
The cost and the limits or the constraints.

00:48:24.060 --> 00:48:26.780
But it's probably like six or seven lines of code.

00:48:26.780 --> 00:48:27.780
It's not a lot.

00:48:27.960 --> 00:48:29.060
No, it's very straightforward.

00:48:29.060 --> 00:48:34.220
The actual, again, coming back to, you know, my thesis, heck, I haven't pulled up, but something

00:48:34.220 --> 00:48:35.520
like 600 lines of code.

00:48:35.520 --> 00:48:39.800
And I want to say two thirds of that was just prepping the data, right?

00:48:39.800 --> 00:48:42.920
And then the actual Piomo work was.

00:48:42.920 --> 00:48:43.620
Yeah, exactly.

00:48:43.620 --> 00:48:44.020
Yeah.

00:48:44.020 --> 00:48:46.280
Maybe of that remaining third half of it.

00:48:46.280 --> 00:48:50.620
And then the last part of that third was like shaping the output to be intelligible,

00:48:50.620 --> 00:48:51.100
right?

00:48:51.100 --> 00:48:53.900
The Piomo itself is pretty clean.

00:48:53.900 --> 00:48:54.220
Right.

00:48:54.220 --> 00:48:54.540
Wow.

00:48:54.540 --> 00:48:54.880
Okay.

00:48:54.880 --> 00:48:55.280
Yeah.

00:48:55.280 --> 00:48:56.480
It definitely looks interesting.

00:48:56.580 --> 00:49:01.060
And it looks very like it solves many different types of classes of problems, right?

00:49:01.060 --> 00:49:04.380
Like linear programming versus nonlinear programming versus stochastic programming.

00:49:04.380 --> 00:49:09.180
And then those solve each many interesting real world problems, right?

00:49:09.180 --> 00:49:11.160
So this is broadly applicable, I think.

00:49:11.160 --> 00:49:11.640
Yeah.

00:49:11.640 --> 00:49:14.800
And I'm one of those guys that's like every problem is a network problem, right?

00:49:14.800 --> 00:49:16.340
And you can feed those to this.

00:49:16.340 --> 00:49:19.340
And then I view the world as either network problems or assignment problems.

00:49:19.340 --> 00:49:23.220
And assignment kind of ties back into some of my work for the government, which is, do we

00:49:23.220 --> 00:49:24.540
have the right people where they need to be?

00:49:24.540 --> 00:49:26.120
And you can throw that at this.

00:49:26.340 --> 00:49:26.420
Yeah.

00:49:26.420 --> 00:49:27.480
Are you a fan of graph theory?

00:49:27.480 --> 00:49:28.200
Yes.

00:49:28.200 --> 00:49:29.240
Yeah, I am too.

00:49:29.240 --> 00:49:29.900
I love that part.

00:49:29.900 --> 00:49:31.000
All right.

00:49:31.000 --> 00:49:34.800
Let me add, I think this is probably a good place to sort of wrap up our general conversation.

00:49:34.800 --> 00:49:35.920
I'll ask you the two questions.

00:49:35.920 --> 00:49:38.800
Anything else we should add to the general conversation before we wrap it up?

00:49:38.800 --> 00:49:41.980
I got to just thank professors Alderson and Carlisle.

00:49:41.980 --> 00:49:46.680
I mean, again, kid from the country didn't know what was going on in life and kind of stumbled

00:49:46.680 --> 00:49:48.800
into this curriculum that has completely changed my life.

00:49:48.800 --> 00:49:53.780
And I've always joked, I'm the dumb, smart kid that's smart enough to get into the advanced

00:49:53.780 --> 00:49:55.120
stuff and then struggle the whole time.

00:49:55.120 --> 00:49:56.800
And yeah.

00:49:57.080 --> 00:49:57.440
Exactly.

00:49:57.440 --> 00:49:59.980
I don't belong here, but somehow they let me in.

00:49:59.980 --> 00:50:01.060
But yeah, that's cool.

00:50:01.060 --> 00:50:01.400
Yeah.

00:50:01.400 --> 00:50:03.180
That happened to me at the nuclear power curriculum.

00:50:03.180 --> 00:50:04.080
It happened to me here.

00:50:04.080 --> 00:50:06.360
I'm forever indebted to those two gentlemen.

00:50:06.360 --> 00:50:08.980
So just thanks to them is something I would love the chance to throw out here.

00:50:09.200 --> 00:50:09.880
Yeah, absolutely.

00:50:09.880 --> 00:50:10.760
All right.

00:50:10.760 --> 00:50:13.860
So before I let you out of here, this has been really interesting, but let me ask you

00:50:13.860 --> 00:50:14.760
the final two questions.

00:50:14.760 --> 00:50:19.560
And I have a twist on the second one because I want to throw out something in addition.

00:50:19.560 --> 00:50:21.960
And while we're talking, because I want to hear your thoughts on it.

00:50:21.960 --> 00:50:22.520
Okay.

00:50:22.520 --> 00:50:24.900
If you're going to write some code, what editor would you use?

00:50:24.900 --> 00:50:27.160
Either Jupyter Notebooks or Sublime Text.

00:50:27.160 --> 00:50:28.600
Jupyter or JupyterLab?

00:50:28.600 --> 00:50:30.760
Ooh, now you're getting beyond my head.

00:50:30.760 --> 00:50:34.520
Have you made the transition over to JupyterLab or are you sticking with the traditional?

00:50:34.520 --> 00:50:35.900
I don't think I have.

00:50:35.900 --> 00:50:37.540
I'm probably stuck in the past.

00:50:37.540 --> 00:50:38.080
Yeah.

00:50:38.320 --> 00:50:39.200
They're pretty similar.

00:50:39.200 --> 00:50:39.760
They're pretty similar.

00:50:39.760 --> 00:50:40.540
All right.

00:50:40.540 --> 00:50:41.080
Good ones.

00:50:41.080 --> 00:50:43.200
And then notable PyPI package.

00:50:43.200 --> 00:50:44.820
Pyama, probably the reason I'm here.

00:50:44.820 --> 00:50:45.880
Right?

00:50:45.880 --> 00:50:47.640
So, yeah.

00:50:47.640 --> 00:50:48.120
Awesome.

00:50:48.120 --> 00:50:49.660
That's really cool.

00:50:49.660 --> 00:50:50.220
That's really cool.

00:50:50.220 --> 00:50:50.700
All right.

00:50:50.700 --> 00:50:53.760
So I put, I want to give a shout out to one because I think this is actually going to

00:50:53.760 --> 00:50:54.440
be pretty interesting.

00:50:54.440 --> 00:50:55.780
I haven't talked about it on Talk Python.

00:50:55.780 --> 00:50:57.000
I have on Python Bytes.

00:50:57.000 --> 00:50:58.280
Do you see that link?

00:50:58.280 --> 00:50:58.460
Yeah.

00:50:58.460 --> 00:50:59.480
Click, open that link.

00:50:59.480 --> 00:51:01.580
And then let me describe this to the people.

00:51:01.580 --> 00:51:02.940
And then you give me your thoughts.

00:51:02.940 --> 00:51:03.860
There's a cool graphic.

00:51:03.860 --> 00:51:06.220
So you don't have to like, there's like an animated GIF.

00:51:06.220 --> 00:51:07.740
So you don't have to like feed.

00:51:07.920 --> 00:51:13.220
So a lot of times what we do is we do math and optimization problems like we're talking

00:51:13.220 --> 00:51:16.600
about here in code.

00:51:16.600 --> 00:51:21.780
And the code looks a little bit like theoretical math, but not really like theoretical math.

00:51:22.360 --> 00:51:29.640
But it would be really nice if you could have like the LaTeX fancy published like math book

00:51:29.640 --> 00:51:31.860
representation of the steps that you're doing.

00:51:32.800 --> 00:51:36.960
So there's a really cool project called Hand Calcs.

00:51:36.960 --> 00:51:38.140
Have you heard of this?

00:51:38.140 --> 00:51:39.440
No, I've not.

00:51:39.440 --> 00:51:49.340
But so I wrote my thesis in LaTeX because there was so much of that fancy math, the actual written

00:51:49.340 --> 00:51:50.000
math, right?

00:51:50.000 --> 00:51:50.920
For all my constraints.

00:51:51.100 --> 00:51:51.460
Yeah.

00:51:51.460 --> 00:51:57.900
And learning LaTeX was a challenge, especially when I'm trying to wrap my mind around my

00:51:57.900 --> 00:51:58.880
actual thesis work.

00:51:58.880 --> 00:52:02.020
So seeing what I'm seeing here and the fact that it's in Python, I'm jealous.

00:52:02.020 --> 00:52:03.600
I'm jealous right now.

00:52:03.600 --> 00:52:03.860
Yeah.

00:52:03.860 --> 00:52:06.860
Just scroll through some of the pictures here and I'll put it in the show notes as well.

00:52:07.100 --> 00:52:12.820
So what you can do is you can write out like statements and equations in Python.

00:52:12.820 --> 00:52:17.460
And then you can say, render with this Hand Calc, you say, render the, what I would have

00:52:17.460 --> 00:52:23.500
done like step-by-step sequence I would have had to do to work out that calculation, right?

00:52:23.500 --> 00:52:29.540
So you could say like X equals negative B plus square root B squared minus 4AC divided by

00:52:29.540 --> 00:52:30.240
two, like quadratic.

00:52:30.240 --> 00:52:36.080
And it'll actually, if it knows what the values of those are, it'll write out the steps of solving

00:52:36.080 --> 00:52:42.140
that equation like bit by bit by bit as you would in like math class, but in Jupyter notebooks.

00:52:42.140 --> 00:52:42.580
Yeah.

00:52:42.580 --> 00:52:43.960
This is super cool.

00:52:43.960 --> 00:52:45.460
Isn't this neat?

00:52:45.460 --> 00:52:49.040
I thought like given what you're talking about, like this, this is a good thing to pair it with.

00:52:49.040 --> 00:52:49.680
Oh yeah.

00:52:49.680 --> 00:52:52.500
I mean, this would have, this would have saved a lot of time.

00:52:52.500 --> 00:52:56.280
What have I done with my life?

00:52:56.280 --> 00:52:57.040
This is pretty new.

00:52:57.040 --> 00:53:00.880
I believe this is from Connor Fester and I'm really impressed with this project.

00:53:00.880 --> 00:53:01.360
This is cool.

00:53:01.360 --> 00:53:01.660
Yeah.

00:53:01.660 --> 00:53:03.700
That's super, super cool.

00:53:04.140 --> 00:53:09.560
Cause I mean, for me, it was either try to use the, in my opinion, atrocious math type

00:53:09.560 --> 00:53:16.060
plugin in word, which not happening or write in LaTeX.

00:53:16.060 --> 00:53:19.140
And this would have been more fun because I would have been able to stick with one.

00:53:19.140 --> 00:53:19.520
Yeah.

00:53:19.520 --> 00:53:21.060
LaTeX is fine, right?

00:53:21.060 --> 00:53:24.720
Like all the math books and all the math papers and physics, I suppose as well.

00:53:24.720 --> 00:53:26.260
Like almost all of them are done in that.

00:53:26.260 --> 00:53:26.520
Right.

00:53:26.680 --> 00:53:31.240
But the thing is now you've got the data in two places and if you change one, but you

00:53:31.240 --> 00:53:32.160
forget to change the other.

00:53:32.160 --> 00:53:33.100
Oh no.

00:53:33.100 --> 00:53:38.360
It's all like, this just takes your Python code and like turns it into symbolic math.

00:53:38.360 --> 00:53:38.900
It's awesome.

00:53:38.900 --> 00:53:39.200
Yeah.

00:53:39.200 --> 00:53:40.060
This is super cool.

00:53:40.060 --> 00:53:40.360
Nice.

00:53:40.360 --> 00:53:40.620
All right.

00:53:40.620 --> 00:53:43.300
Well, let's leave it with hand calcs and a final call to action.

00:53:43.300 --> 00:53:48.420
People want to get started with these types of problems and like using libraries like this.

00:53:48.420 --> 00:53:49.260
What do you say?

00:53:49.480 --> 00:53:52.660
Well, if you want to use Pyamo, if you're listening to this podcast, you're probably

00:53:52.660 --> 00:53:55.060
familiar with some of those classic computer science problems.

00:53:55.060 --> 00:54:00.660
I'd say pip install Pyamo and try to structure one of those problems in that system.

00:54:00.660 --> 00:54:03.320
Then my other, I guess I'm going to have two calls to actions.

00:54:03.320 --> 00:54:03.940
I'm cheating.

00:54:03.940 --> 00:54:04.920
Go for it.

00:54:04.920 --> 00:54:08.380
The other one I'll say is from that analyst perspective, kind of bringing it full circle

00:54:08.380 --> 00:54:12.520
to Jacqueline and Emily, I get looked at at work like I'm a sorcerer because of some

00:54:12.520 --> 00:54:16.780
of my Python skills and listening to some of your guests, like I'm not right.

00:54:16.780 --> 00:54:22.020
But your calls to action often reach out saying, Hey, you know, maybe you're that person in

00:54:22.020 --> 00:54:26.140
a job and you have this one Excel task that you do all the time, right?

00:54:26.140 --> 00:54:27.120
You could automate that.

00:54:27.120 --> 00:54:35.800
Well, I'm kind of that guy in a way where the calls to action that you've sent out, again,

00:54:35.800 --> 00:54:38.080
I'm that person who has been automating things.

00:54:38.080 --> 00:54:42.800
There was one example where we literally had people going through surveys by hand.

00:54:42.800 --> 00:54:46.540
So this is surveys where like we ask our sailors, how do you feel about A, B, C, and

00:54:46.540 --> 00:54:46.720
D?

00:54:47.200 --> 00:54:48.960
And they used to go through them by hand.

00:54:48.960 --> 00:54:51.480
And I was like, that can be better, right?

00:54:51.480 --> 00:54:51.960
And so just...

00:54:51.960 --> 00:54:54.460
This can't be the best way.

00:54:54.460 --> 00:54:55.500
No, right?

00:54:55.500 --> 00:55:00.140
And so we had the data digitally and I'm not even an NLP, not to be confused with nonlinear

00:55:00.140 --> 00:55:02.420
programming, but I'm not a natural language processing guy.

00:55:02.420 --> 00:55:07.640
But I installed some packages and was able to try to get sentiment out of surveys, right?

00:55:07.640 --> 00:55:07.960
And so...

00:55:07.960 --> 00:55:09.100
Oh, that's cool.

00:55:09.100 --> 00:55:13.040
I just say that the power of this language can help at all levels.

00:55:13.040 --> 00:55:14.760
And I'm at a fairly high level of government.

00:55:14.760 --> 00:55:16.160
It's incredible what it does for us.

00:55:16.480 --> 00:55:21.140
So the call to action, I suppose I'm rambling a little bit, is if you are that guy out there,

00:55:21.140 --> 00:55:24.120
take it from another one of that guy that it really does work.

00:55:24.120 --> 00:55:24.420
Yeah.

00:55:24.420 --> 00:55:25.040
Yeah.

00:55:25.040 --> 00:55:26.320
I think it's great.

00:55:26.320 --> 00:55:31.680
And you're in one of these positions where you're a little bit on the boundary of a lot

00:55:31.680 --> 00:55:32.940
of people who need answers.

00:55:32.940 --> 00:55:37.320
They have a lot of data, but they can't answer the question themselves through code or programming

00:55:37.320 --> 00:55:38.780
or anything along those lines.

00:55:39.220 --> 00:55:44.600
And so it's like right there for you to just take that little step and come across as a

00:55:44.600 --> 00:55:44.860
magician.

00:55:44.860 --> 00:55:51.640
Like I do like to say that developers, data scientists, people who can write code, we really are in some

00:55:51.640 --> 00:55:56.500
sense, the wizards or magicians of the modern era, right?

00:55:56.700 --> 00:56:00.320
You think about an idea, you sort of do the incantation.

00:56:00.320 --> 00:56:05.020
And then out of just energy in your thought comes a thing that can have huge impact.

00:56:05.020 --> 00:56:09.920
And those don't have to be, oh, I created some huge, like I created Airbnb or whatever.

00:56:09.920 --> 00:56:15.360
It could be there are people that can now focus on stuff that humans are good at and not just

00:56:15.360 --> 00:56:19.440
typing in, moving stuff around from one Excel sheet to the other, to copy it over to PowerPoint,

00:56:19.440 --> 00:56:20.560
to show it to the general.

00:56:20.560 --> 00:56:21.680
Yep, absolutely.

00:56:21.680 --> 00:56:22.880
I have so many examples.

00:56:22.880 --> 00:56:23.760
I can give you one more.

00:56:23.760 --> 00:56:29.260
Like we have this huge database of what civilian skills people have in the Navy Reserve, which

00:56:29.260 --> 00:56:32.960
is a unique thing of us because we have our reservists have their military life, but they

00:56:32.960 --> 00:56:33.840
have their civilian life.

00:56:33.840 --> 00:56:39.800
And facets of their civilian life might be applicable skill sets that we could employ in a military

00:56:39.800 --> 00:56:40.400
context.

00:56:40.400 --> 00:56:45.740
And whoever designed the system to capture this only set up free text entry.

00:56:46.960 --> 00:56:55.300
So imagine if you have 20,000 people do free text entry of what they're capable of, right?

00:56:55.300 --> 00:56:58.460
You're like, couldn't I have just gotten a combo box?

00:56:58.460 --> 00:57:01.600
Exactly.

00:57:01.600 --> 00:57:02.340
But...

00:57:02.340 --> 00:57:04.760
Or a radio button list or something.

00:57:04.760 --> 00:57:08.140
Some kind of dropdown, maybe some cascading dropdown menus, right?

00:57:08.140 --> 00:57:13.960
But so I inherited that database and it was sort of one of those, can you make anything of

00:57:13.960 --> 00:57:14.240
this?

00:57:14.240 --> 00:57:17.740
And right at the same time, a pretty high level individual was coming to us saying,

00:57:17.740 --> 00:57:21.200
hey, do you have anyone with civilian skills to do this?

00:57:21.200 --> 00:57:25.640
And I just wrote the world's most basic query and was like, yeah, we got seven.

00:57:25.640 --> 00:57:26.180
Here they are.

00:57:26.180 --> 00:57:27.040
Right?

00:57:27.040 --> 00:57:28.220
Yeah, that's awesome.

00:57:28.220 --> 00:57:31.580
And you would have thought I'd like conjured a spell, right?

00:57:31.580 --> 00:57:32.180
And...

00:57:32.180 --> 00:57:32.360
Yeah.

00:57:32.360 --> 00:57:36.020
So this is why I made that source for a common beginning of this.

00:57:36.020 --> 00:57:38.000
It really is incredible what you can do.

00:57:38.000 --> 00:57:38.820
It absolutely is.

00:57:38.820 --> 00:57:40.760
And it's within everyone's reach, I think.

00:57:40.940 --> 00:57:41.180
Yeah.

00:57:41.180 --> 00:57:44.340
It just takes a little bit of practice and a little bit of trying it out.

00:57:44.340 --> 00:57:44.560
Yeah.

00:57:44.560 --> 00:57:45.340
All right, Clark.

00:57:45.340 --> 00:57:46.240
Thank you so much for being here.

00:57:46.240 --> 00:57:49.820
It's been a lot of fun to talk about all these problems and cool work.

00:57:49.820 --> 00:57:54.600
And thanks for helping us all live a little healthier lives, getting our diet figured out.

00:57:54.600 --> 00:57:58.600
Four cheeseburgers, five servings of fries, a fish sandwich, and four milks.

00:57:58.600 --> 00:57:59.580
You're set.

00:57:59.580 --> 00:58:00.540
You're set.

00:58:00.540 --> 00:58:02.540
You're going to live forever.

00:58:02.540 --> 00:58:03.140
Optimally.

00:58:03.140 --> 00:58:03.860
All right.

00:58:03.860 --> 00:58:04.640
Great to chat with you.

00:58:04.640 --> 00:58:06.180
All right.

00:58:06.240 --> 00:58:06.640
Thanks, Michael.

00:58:06.640 --> 00:58:07.480
Yeah.

00:58:07.480 --> 00:58:07.780
Bye-bye.

00:58:07.780 --> 00:58:11.700
This has been another episode of Talk Python To Me.

00:58:11.700 --> 00:58:14.180
Our guest on this episode was Clark Petrie.

00:58:14.180 --> 00:58:18.320
And it's been brought to you by us over at Talk Python Training and our friends at Linode.

00:58:18.320 --> 00:58:23.200
Simplify your infrastructure and cut your cloud bills in half with Linode's Linux virtual machines.

00:58:23.200 --> 00:58:26.560
Develop, deploy, and scale your modern applications faster and easier.

00:58:26.560 --> 00:58:31.520
Visit talkpython.fm/Linode and click the Create Free Account button to get started.

00:58:31.520 --> 00:58:33.440
Want to level up your Python?

00:58:33.440 --> 00:58:38.300
If you're just getting started, try my Python Jumpstart by Building 10 Apps course.

00:58:38.300 --> 00:58:43.380
Or if you're looking for something more advanced, check out our new async course that digs into

00:58:43.380 --> 00:58:46.460
all the different types of async programming you can do in Python.

00:58:46.460 --> 00:58:50.420
And of course, if you're interested in more than one of these, be sure to check out our

00:58:50.420 --> 00:58:51.120
Everything Bundle.

00:58:51.120 --> 00:58:53.000
It's like a subscription that never expires.

00:58:53.000 --> 00:58:55.140
Be sure to subscribe to the show.

00:58:55.140 --> 00:58:57.660
Open your favorite podcatcher and search for Python.

00:58:57.660 --> 00:58:58.780
We should be right at the top.

00:58:58.780 --> 00:59:03.620
You can also find the iTunes feed at /itunes, the Google Play feed at /play,

00:59:03.620 --> 00:59:07.780
and the direct RSS feed at /rss on talkpython.fm.

00:59:07.780 --> 00:59:09.860
This is your host, Michael Kennedy.

00:59:09.860 --> 00:59:11.360
Thanks so much for listening.

00:59:11.360 --> 00:59:12.400
I really appreciate it.

00:59:12.400 --> 00:59:14.160
Now get out there and write some Python code.

00:59:14.160 --> 00:59:34.120
I'll see you next time.

00:59:34.120 --> 00:59:34.820
Thank you.

