Lex Fridman PodcastTravis Oliphant: NumPy, SciPy, Anaconda, Python & Scientific Programming | Lex Fridman Podcast #224
EVERY SPOKEN WORD
150 min read · 30,033 words- 0:00 – 1:11
Introduction
- LFLex Fridman
The following is a conversation with Travis Oliphant, one of the most impactful programmers and data scientists ever. He created NumPy, SciPy, and Anaconda. NumPy formed the foundation of tensor-based machine learning in Python, SciPy formed the foundation of scientific programming in Python, and Anaconda, specifically with Conda, made Python more accessible to a much larger audience. Travis's life work across a large number of programming and entrepreneurial efforts has and will continue to have immeasurable impact on millions of lives by empowering scientists and engineers in big companies, small companies, and open source communities to take on difficult problems and solve them with the power of programming. Plus, he's a truly kind human being, which is something that when combined with vision and ambition, makes for great leader and a great person to chat with. To support this podcast, please check out our sponsors in the description. This is the Lex Fridman podcast, and here is my conversation with Travis Oliphant.
- 1:11 – 22:52
Early programming
- LFLex Fridman
What was the first computer program you've ever written? Do you remember?
- TOTravis Oliphant
Whoa. That's a good question. I think it was in fourth grade. Just a simple, uh, loop in Basic.
- LFLex Fridman
Basic?
- TOTravis Oliphant
Basic, yeah, on an Atari 800, uh, Atari 400, I think, or maybe it was an Atari 800. It was, uh, part of a class, and we just were, just basic loops to print things out.
- LFLex Fridman
Did you use go-to statements?
- TOTravis Oliphant
Um, yes. Yes, we used go-to statements. (laughs)
- LFLex Fridman
(laughs) I, I remember in the early days, that's when I first realized there's, like, principles to programming-
- TOTravis Oliphant
Yeah.
- LFLex Fridman
... when I was told that don't use go-to statements.
- TOTravis Oliphant
Yeah.
- LFLex Fridman
Those are bad software engineering prince, like, it goes against what great, beautiful code is. And I was like, "Oh, okay, there's rules to this game."
- TOTravis Oliphant
(laughs)
- LFLex Fridman
(laughs)
- TOTravis Oliphant
I didn't see that until high school when I took an AP Computer Science course.
- LFLex Fridman
Right.
- TOTravis Oliphant
I d- I did a lot of other kinds of just low, programming on TI, but finally when I took an AP Computer Science course in Pascal.
- LFLex Fridman
Pas... Wow.
- TOTravis Oliphant
That's, yeah, it was Pascal. That's when I, "Oh, there are these principles."
- LFLex Fridman
Not C or C++?
- TOTravis Oliphant
No, I didn't take C until (laughs) ha- uh, the next year in college. I had this course in C, um, but I, I haven't done much in Pascal, just that AP Computer Science course. (laughs)
- LFLex Fridman
Now, sorry for the romanticized question, but when did you first fall in love with programming?
- TOTravis Oliphant
Oh, man. Good question. I think actually when I was 10. You know, my dad got us a TI- Timex Sinclair, and, uh, he was excited about the spreadsheet capability, and then, but I made him get the, uh, Basic, the add-on so we could actually program in Basic. And just being able to write instructions and have the computer do something. Then we got a TI-90, a TI-99/4A when I was about 12, and I would just, it had sprites and graphics and music. You could actually program it to do music. That's when I really sort of fell in love with programming.
- LFLex Fridman
So, this is a full, like, a real computer with like, uh, with memory and storage-
- TOTravis Oliphant
Yeah.
- LFLex Fridman
... and processor and whatnot?
- TOTravis Oliphant
Yeah, the Timex-
- LFLex Fridman
'Cause you say TI, it's not-
- TOTravis Oliphant
Yeah, the Timex Sinclair was one of the very first. It was a cheap, cheap, like I think it was... Well, it was still expensive, (laughs) but it was 2K of memory. We got the 16K add-on pack.
- LFLex Fridman
Mm-hmm.
- TOTravis Oliphant
Uh, but yeah, it had memory and you could program it. You had the, in order to store your programs, you had to attach a tape drive. Remember that old, the sound that would play when you-
- 22:52 – 39:46
SciPy
- TOTravis Oliphant
- LFLex Fridman
I don't know what to start talking to you about 'cause you've been... You've created (laughs) so many incredible projects that basically changed the whole landscape of programming. But okay, let's start with, uh, let's go chronologically with SciPy. You created SciPy over two decades ago now?
- TOTravis Oliphant
Yes.
- LFLex Fridman
Is that right? Is it-
- TOTravis Oliphant
Yes. Love to talk about SciPy. SciPy-
- LFLex Fridman
(laughs)
- TOTravis Oliphant
... was really my baby. (laughs)
- LFLex Fridman
(laughs) What is it?
- TOTravis Oliphant
Yeah.
- LFLex Fridman
Uh, what was its goal? What is its goal? How does it work?
- TOTravis Oliphant
Yeah, fantastic. So SciPy was effectively... Here I am using Python-
- LFLex Fridman
Mm-hmm.
- TOTravis Oliphant
... to do stuff that I previously used MATLAB to use. And I was using Numerical, which is an array library that made a lot of it possible. But I... You know, there's things that were missing. Like, I didn't have an ordinary differential equation solver I could just call, right? I didn't have integration. Yeah, I wanted to, uh, to integrate this function. Okay, well, I don't have just a function I can call to do that. Um, these are things I remember being critical things that I was missing. Optimization. I just wanna pass a function to an optimizer and have it tell me what the optimum value is. Uh, those are things like, "Well, why don't we just write a library that adds these tools?" And I started to post on the mailing list, and there'd previously been... You know, people have discussed. I remember Conrad Henson saying, "Wouldn't it be great if we had this optimizer library?" Or-
- LFLex Fridman
Yeah.
- TOTravis Oliphant
... David Ash would say this stuff. And, and I'm... You know, I'm a ambitious... Uh, uh, ambition is the wrong word. An eager (laughs) and, uh, probably more time than sense, I was, you know, a poor graduate student.
- LFLex Fridman
(laughs)
- TOTravis Oliphant
Uh, my wife thinks I'm working on my PhD, and I am, but part of a PhD that I loved was the fact that it's exploratory.
- LFLex Fridman
Mm-hmm.
- TOTravis Oliphant
Right? You're not just, you know, taking orders fulfilling, uh, a list of things to do. You're trying to figure out what to do. And so I thought, "Well, you know, I'm writing tools for my own use in a PhD, so...... I'll just start this project. And so in '99, '98 was when I first started to write libraries for Python. Effectively, when I fell in love with Python in '98, I thought, "Oh, well, there's just a few things missing." Like, oh, I need a reader to read DICOM files, that was in medical imaging and DICOM was a format that I wanted to be able to load that into Python. Okay, how do I write a reader for that? So I wrote something called... It was an IO package, right?
- LFLex Fridman
Mm-hmm.
- TOTravis Oliphant
And that was my very first extension module, which is C. So I wrote C code to extend Python so that the pos- in Python, I could write things more easily. That, that combination kind of hooked me. It was the idea that I could, here's this powerful tool I can use as a scripting language and a high-level language to think about, but that I can extend easily.
- LFLex Fridman
In C?
- TOTravis Oliphant
Easily in, in C. The easily for me because I knew enough C.
- LFLex Fridman
Right.
- TOTravis Oliphant
And then Guido had written a lang- I mean, the only, the hard part of extending Python was something called the way memory management works, and you have to do reference counting. And so there's, there's a tracking of reference counting you have to do manually. And if you don't, you have a ref- you have memory leaks (laughs) . And, uh, so that's hard. Plus then C, you know, it's just much more... You have to put more effort into it. It's not just I have to now think about pointers and I have to think about stuff that is different. I have to kind of... You're like putting a new cartridge in your brain.
- LFLex Fridman
Mm-hmm.
- TOTravis Oliphant
Like, you're... Okay, I'm thinking about MRI, now I'm thinking about programming, and, and there are distinct modules you (laughs) end up having to think about. So it's harder. And when I was just in Python, I could just think about MRI-
- LFLex Fridman
Right.
- TOTravis Oliphant
... and high-level wro- writing. Um, but I could do that, and that kind of... I liked it. I found that to be enjoyable and fun, and so I ended up, "Oh, let me just add a bunch of stuff to Python to do integration." Well, and the cool thing is, is that, you know, the power of the internet, just looking around, and I found, oh, there's this NetLib, which has hundreds of Fortran routines that people had written in the '60s and the '70s and the '80s in Fortran 77, fortunately, it wasn't Fortran 60. So they've been mo- ported to Fortran 77.
- LFLex Fridman
Mm-hmm.
- 39:46 – 51:29
Open source
- TOTravis Oliphant
So I'm not opposed to proprietary software.
- LFLex Fridman
Yeah.
- TOTravis Oliphant
I'm actually not an open source zealot. I love open source for the... what it brings, but I also see the role for proprietary software. But what I didn't like was the fact that I would develop code and publish it, and then effectively telling somebody, "Here, to run my code, you have to have this proprietary software."
- LFLex Fridman
Right. And there's also culture around MATLAB as much, because I've talked to a few folks at, uh, MathWorks creates MATLAB?
- TOTravis Oliphant
Yeah.
- LFLex Fridman
Yeah. I mean, there's just a culture, they try really hard, but it's just there's this corporate IBM style culture that's like-
- TOTravis Oliphant
Yes. Yes.
- LFLex Fridman
... or whatever. I don't, don't want to say negative things about IBM or whatever, but there's a, is a-
- TOTravis Oliphant
No, it's, it's, it's really that connection. It's something I'm in the middle of right now is, is the business of open source-
- LFLex Fridman
Right. Right.
- TOTravis Oliphant
... and how do you connect the ethos of cooperative development with the necessity of, of creating profits?
- LFLex Fridman
Right.
- TOTravis Oliphant
Right. And, like, right now today, you know, I'm still, I'm still in the middle of that. That's actually the early days, uh, of, of me exploring this question. Because I was writing SciPy, I mean, as an aside, I also had... so I had three kids at the time. I have six kids now.
- LFLex Fridman
Yeah.
- TOTravis Oliphant
I got married early, wanted a family. Uh, I had three kids and I remember reading... I remember I read Richard Stallman's post and I was, I was a fan of Stallman. I would read his work. I liked this collective ideas he would have. Certainly the ideas on IP law, I read a lot of his stuff. But then he said, you know, "Okay, well, how do I make money with this? How do I make a living? How do I pay for my kids?" All this stuff was in my mind, young graduate student making no money thinking, "I got to get a job." And he said, "Well, you know, I think just be like me and don't have kids." Right. That's... just don't, don't-
- LFLex Fridman
That's his take on this? That's his side?
- TOTravis Oliphant
That was his... that was, that was the, what, what he said in that moment, right?
- LFLex Fridman
Yeah.
- TOTravis Oliphant
That's the thing I read and I went, "Okay, this is a train I can't get on." (laughs)
- LFLex Fridman
Yeah. There has to be a way to preserve the culture of open source and still be able to make sufficient money to feed your kids.
- TOTravis Oliphant
Yes, exactly. There's got to be. Well, so that actually led me to a study of economics. Because at the time I was ignorant and I really was, and I'm actually... I'm embarrassed for educational system that they could let me... and I was valedictorian of my high school class and I did super well in college and, like, academically I did great.
- LFLex Fridman
Mm-hmm.
- TOTravis Oliphant
Right. But the fact that I could do that and then be clueless about this key part of life, it led me to go, "There's a problem." Like, I should, like, I should have learned this in fifth grade. I should have learned this in eighth grade. Like, everybody should come out with a basic knowledge of economics.
- LFLex Fridman
You're an interesting example because you've created tools that, uh, change the lives of probably millions of people and the fact that you don't understand at the time of the creation of those tools, the basics economics of how-
- TOTravis Oliphant
Yeah.
- LFLex Fridman
... like, to build up giant system is a problem. (laughs)
- TOTravis Oliphant
Yeah, it's a problem. And so I... during my PhD at the same time, this is actually in '98, '99 at the same time, I was in the library, I was reading books on capitalism, I was reading books on Marxism, I was reading books on, you know, what is this thing? What, what does it... what does it mean?
- LFLex Fridman
Yeah.
- TOTravis Oliphant
And I encountered a... I basically, what I... I encountered a set of writings from people that said they were the inheritors of Adam Smith.
- LFLex Fridman
Mm-hmm.
- 51:29 – 1:28:44
NumPy
- TOTravis Oliphant
At the same time, 2001 timeframe, there was a little bit of, um, like the Hubble Space Telescope.
- LFLex Fridman
Mm-hmm.
- TOTravis Oliphant
The folks at Hubble had started to say, "Hey Python, we're gonna use Python for processing images from Hubble." And so Perry Greenfield was, uh, a good friend and, uh, and running that program. And he had called me before I left to BYU and said, "You know, we wanna do this, but num- Numeric actually has some challenges in terms of, you know, it's not a... The array doesn't have enough types. Uh, we need more operations. You know, broadcast needs to be a little more settled." Uh, they wanted record arrays. They wanted, you know, record arrays are like a data frame, but a little bit different. But they wanted more structured data. So he had called me even early on then and he said, "You know, way, would you wanna work on something to make this work?" And I said, "Yeah, I'm interested, but I'm going here and I, you know, we'll see if I have time." So in the meantime, while I was teaching and, and SciPy was emerging, and I had a student... I was constantly, while I was teaching, trying to figure out a way to fund this stuff. So I had a graduate student, uh, my only graduate student, uh, a Chinese fellow, uh, Hong- Liu Hongzhe is his name. Great guy. He wrote a bunch of stuff for iterative, iterative linear algebra.
- LFLex Fridman
Mm-hmm.
- TOTravis Oliphant
Like, got into writing some of the iterative linear algebras, uh, tools that are currently there in SciPy and emer- and have, they've gotten better since. But this is in 2005, kept working on SciPy. But Perry had started working on a replacement to Numeric called NumArray.
- LFLex Fridman
Mm-hmm.
- TOTravis Oliphant
And in 2004, a package called NDImage, it was an image processing library-
- LFLex Fridman
Nice.
- TOTravis Oliphant
... that was written for NumArray, and it had in it a morphology tool. I don't know if you know what morphology is.
- LFLex Fridman
Mm-hmm. Mm-hmm.
- TOTravis Oliphant
It's open dilations, closed... You know, there's sort of this... As a medical imaging student, I knew what it was because it was used in segmentation a lot.
- LFLex Fridman
Mm-hmm.
- TOTravis Oliphant
And in fact, I'd wanted to do something like that in Python, in SciPy, but just had never gotten around to it. So when it came out that it worked only on Numer- on NumArray, and SciPy needed Numeric. And so we effectively had the beginning of this split.
- LFLex Fridman
Mm-hmm.
- TOTravis Oliphant
And Numeric and NumArray didn't share data, they were just two... So you could have a gigabyte of Numer- NumArray data and gigabyte of Numeric data, and they wouldn't share it.
- LFLex Fridman
Yeah.
- TOTravis Oliphant
And so you had these, and you had these scientific libraries written on top. I got really bugged by that.
- LFLex Fridman
Yeah.
- TOTravis Oliphant
I got really like, "Oh man, this is not good. We're not cooperating now. We're not... We're sort of redoing each other's work and we're just, this young community." So that's what led me... Even though I knew it was risky because my, uh, you know, I had... I was on a tenure track position, 2004 I got reviewed. They said, "Hey, things are going okay. You're doing well. Paper's coming out, but you kind of spend a lot of time on this open source stuff. Maybe do a little less of that and a little more of the paper writing and grant writing." Which was naive, but it was definitely the time, you know, the thinking that-
- LFLex Fridman
Still goes on.
- TOTravis Oliphant
Still goes on.
- LFLex Fridman
You're basically creating a thing which enables science in the 21st century.
- TOTravis Oliphant
Right.
- LFLex Fridman
Um, maybe don't emphasize that so much in your-
- TOTravis Oliphant
Right.
- LFLex Fridman
... for your tenure.
- TOTravis Oliphant
Right. (laughs) It illustrates some of the challenges.
- LFLex Fridman
Yes.
- TOTravis Oliphant
It, it, it does. It's, and it's... People mean well-
- LFLex Fridman
Yes.
Episode duration: 3:05:24
Install uListen for AI-powered chat & search across the full episode — Get Full Transcript
Transcript of episode gFEE3w7F0ww
Get more out of YouTube videos.
High quality summaries for YouTube videos. Accurate transcripts to search & find moments. Powered by ChatGPT & Claude AI.
Add to Chrome