Latest / Talk Python To Me / #252: What scientific computing can learn from CS
Transcript
- 0:00Did you come into Python from a computational science side of things?
- 0:03Were you just looking for something better than Excel and MATLAB and you got pulled in
- 0:07by all that Python has to offer?
- 0:09That's great.
- 0:10But following that path often means some formal practices from software development weren't
- 0:16part of that journey.
- 0:17On this episode, you'll meet Martin Haru, who does data science in the context of academic
- 0:21research.
- 0:22He's here to share his best practices and lessons for data scientists of all sorts.
- 0:27This is Talk Python To Me, episode 252, recorded January 30th, 2020.
- 0:32Welcome to Talk Python To Me, a weekly podcast on Python, the language, the libraries, the
- 0:50ecosystem, and the personalities.
- 0:51This is your host, Michael Kennedy.
- 0:53Follow me on Twitter where I'm @mkennedy.
- 0:56Keep up with the show and listen to past episodes at talkpython.fm and follow the show on Twitter
- 1:01via at Talk Python.
- 1:02This episode is sponsored by Clubhouse and Linode.
- 1:05Please check out what they're offering during their segments.
- 1:08It really helps support the show.
- 1:09Hey everyone, a couple of announcements.
- 1:11First, I have a very exciting new course that we just launched this week.
- 1:16If you've always wanted to solidify your programming foundations and get into Python, but you've
- 1:21never had the chance to take a computer science course, I built a course for you.
- 1:25It's called Python for the Absolute Beginner.
- 1:28It's for absolute beginners because we start from the very beginning.
- 1:32How to install Python?
- 1:33What is a variable?
- 1:34Why do we need loops?
- 1:35And so on.
- 1:36And then we go on to build some really fun projects that will teach you 80% of the Python
- 1:41language.
- 1:42Another challenge people run into when learning programming is having something to work on
- 1:46that's not too big, not too small, but just right that'll actually teach them what they're
- 1:51studying.
- 1:51That's why this course is 50% video lecture and 50% hands-on exercises.
- 1:57So if this sounds useful to you or to your colleagues, visit talkpython.fm/beginners to find
- 2:03out more.
- 2:03Another quick announcement.
- 2:05Last week, we had a brand new sponsor, Springboard.
- 2:08I'm super happy to have them supporting the show, but I did forget to mention something that
- 2:12I think will be really useful for a lot of you.
- 2:14If you want to take one of their AI or machine learning online career tracks, they're offering
- 2:1920 scholarships worth $500 each exclusively to Talk Python listeners using the code Talk Python
- 2:26to me, all one word, all caps.
- 2:28And it only takes 10 minutes to apply.
- 2:30So that's the thing I left out.
- 2:32Use that code, get the $500 scholarship, Talk Python To Me, all one word.
- 2:36Just visit talkpython.fm/Springboard if you're interested.
- 2:40And another announcement.
- 2:42Recently, we've had to trim back our RSS feed length.
- 2:46It had all 252 episodes in there, all the show notes and everything.
- 2:52And as far as I was concerned, we were going to ship those to you all.
- 2:56As long as we could.
- 2:57I want to make sure that everyone can go back through the entire catalog and get everything
- 3:01that they want.
- 3:02And yet, because of the size, I think some of the players, especially in the Apple ecosystem,
- 3:08started to go crazy and ship old episodes as if they were new and to not show the latest
- 3:15ones.
- 3:15And all sorts of weird things started happening.
- 3:18So in order to fix this, or let's say rather in order to attempt to fix this, and it seems
- 3:24to have worked, we've reduced our RSS feed to only show the last half a year of episodes.
- 3:29Again, that's not because we don't want you to get the old ones.
- 3:32That's because we want you to get at least the new ones.
- 3:35So what a pain.
- 3:36But I know that some of you are going through the entire catalog and learning as you go,
- 3:43trying to go through the entire history of what we've done, which thank you.
- 3:46That kind of blows my mind.
- 3:47That's an incredible effort.
- 3:49So what I've done is I've also made a separate RSS feed that is not part of the subscribe
- 3:53at iTunes or subscribe at Google Play feed because that's where the problems were.
- 3:57If the entire RSS feed works for your player, you're welcome to have it.
- 4:02I put it up at talkpython.fm/episodes /rss underscore full underscore history.
- 4:07You can get that in the links for your in this show in the show notes here.
- 4:12And you can also get that on the footer of every single page at talkpython.fm.
- 4:16So that's the easiest way to get it.
- 4:18Just go to the bottom, look for the RSS full history link and put that link directly into
- 4:23your podcast player if you want to get the full history.
- 4:26If you're happy with the latest half year, just do nothing and make sure you're subscribed
- 4:31as you have been and you'll keep getting the new episodes, hopefully without any hiccups
- 4:36this time.
- 4:37Martin, welcome to Talk Python To Me.
- 4:39Hi, Michael.
- 4:40How's it going?
- 4:40Hey, it's going really well.
- 4:41I'm happy to have you on the show.
- 4:42Thank you very much for having me.
- 4:43Yeah.
- 4:44We're going to talk about the science side of Python, which I think is a really interesting
- 4:49place to talk.
- 4:50You know, if there's that famous, well-known article called entitled The Incredible Growth
- 4:56of Python done by the data scientists at Stack Overflow.
- 4:59And there's this super sharp inflection point around 2012 where the growth of Python, which
- 5:05had been pretty stable, it was like a third, fourth tier rank language.
- 5:10And then it just took off at that point and went up and up and up.
- 5:14And I think my theory is a lot of people came in from data science, but I think that that
- 5:20kind of overshadows that there are just a lot of people that started adopting Python for
- 5:25this a little bit beyond Excel or the first, I just need to do a little coding or I just
- 5:30need to do a little automation.
- 5:31And I think people are just coming into this from so many angles.
- 5:35And I think that a large portion of that probably is scientists.
- 5:37What do you think?
- 5:37I totally agree.
- 5:38I mean, that's how I came into getting into Python was a transition from MATLAB, for example,
- 5:44as a early first language for anybody who's interested in doing just that little bit of
- 5:48automation, that little bit of something to go beyond Excel.
- 5:51I think Python's perfect.
- 5:53And now with the tooling and, for example, Anaconda, those types of things, it just makes
- 5:57it so accessible.
- 5:57Yeah, absolutely.
- 5:58You know, my theory, the reason it's really popular is you don't have to take on all the
- 6:03computer science ideas and concepts all at once.
- 6:06You don't have to have a static class and a function with accessibility modifiers and
- 6:10all that.
- 6:10It's just like, well, just write the three lines you need here.
- 6:13And then, oh, if you need this idea of functions, then you can learn them.
- 6:15If you need classes, you can learn them and so on.
- 6:17It's really, really approachable.
- 6:18Yeah, no, I totally agree with that.
- 6:20For sure.
- 6:20And now, before we get too much into our topic, let's start with your story.
- 6:25How'd you get into programming in Python?
- 6:26Unlike some of your previous guests, I'm not your traditional path person.
- 6:30I'm a physiotherapist by training.
- 6:32And then after that, went on to do graduate work.
- 6:35And it's after my master's, did a PhD.
- 6:37And it's during the PhD that I learned two different languages that are very different
- 6:42from each other.
- 6:42One of them was LabVIEW programming.
- 6:44And that was for my data acquisition and interface for data collection.
- 6:47And that's, I guess you can call it coding.
- 6:49Is it more of a visual type of day, like ETL type thing?
- 6:53Yeah, and you connect your lines.
- 6:55And one person, when they saw the back, not the front end, but the back end of my program
- 6:58one said, it looks like a bomb diagram, which, you know, it kind of, I guess it does.
- 7:01So it's all this spaghetti behind the scenes.
- 7:03The logic is there once you understand coding, but it doesn't teach you how to program properly.
- 7:08But then at the same time, my supervisor took on the task of teaching me MATLAB, which by
- 7:13the end of my PhD, I was quite competent in.
- 7:14And it was a great skill.
- 7:15Those two together worked quite well.
- 7:18And then I progressed, did my postdoc and continued that, a lot of MATLAB.
- 7:22And then it was really, I'd heard of Python from a colleague that went to do some post-grad
- 7:29work in San Francisco.
- 7:30And I met her at a conference and she says, oh, the folks I work with use Python.
- 7:34And so me being just curious, I went and looked at it, but that was probably, you know, 2007,
- 7:412008 or something.
- 7:42And I kind of read on it, read up, I saw these tutorials on, you know, going to Python.
- 7:48from MATLAB.
- 7:48But the tooling still wasn't there, the how to install it, how to get the various packages.
- 7:53I tried for a couple of weekends and then I just kind of gave up because obviously I was
- 7:57proficient at MATLAB and I didn't, I'm not a programmer.
- 7:59I just wanted to get my job done, my research done.
- 8:02So, right.
- 8:02And a lot of the stuff, the data science tools and libraries were just early seeds growing
- 8:08at that time, right?
- 8:09I think NumPy came out, it was created around that time and probably Matplotlib and Jupyter
- 8:15wasn't around yet.
- 8:16So there was a lot of support that wasn't there, right?
- 8:19Exactly.
- 8:19So for somebody who's, you know, in a sense, a non-expert, it was just too daunting.
- 8:23And so therefore I went back to MATLAB and then it was just, finally, I'm a Linux person.
- 8:29I started that in probably 2010 maybe and I've never looked back.
- 8:34I've been using Linux the whole time.
- 8:35So I'm quite...
- 8:35What distribution are you on these days?
- 8:37Linux Mint or Ubuntu kind of depends on pretty much how I'm feeling on the day that I install,
- 8:42but it's between those two usually.
- 8:44Okay, cool.
- 8:45It's just what I've run on my computers.
- 8:46I put it on my mom's computer so I can help her out from a distance because it's kind of
- 8:50easy.
- 8:50You can use older computers and just use it in the lab or for some of the experiments we
- 8:54run.
- 8:54We just need basic computers.
- 8:56So I just thought it was a nice way to reuse some of the equipment.
- 8:59And then with this open source kind of mind and that I had, Python started to be a little
- 9:05bit more appealing and then I looked a little, again, revisited it, partly because I was looking
- 9:09at the courses for software carpentry, which is this thing that teaches scientists that have
- 9:14no computer skills, some of the basic skills and usually around either R or Python and you
- 9:20get a bit of shell and you get some Git.
- 9:22And so that really made me look again into Python.
- 9:25And from there, that's all I've been using for the last maybe four or five years now.
- 9:29Beautiful.
- 9:30Yeah, the software carpentry stuff is pretty interesting.
- 9:33I've had the folks behind that on the show before.
- 9:36It's not a lot, right?
- 9:37It's not a lot to get you started.
- 9:38It's a couple of days, a little bit of, it's not even all programming.
- 9:42It's here's how to use a shell and here's what source control is and so on.
- 9:45But at least it plants the seed like, hey, these are things you should pay attention to.
- 9:49Yeah, it's really, here's the landscape of a few things and it's a teaser.
- 9:54But if you have some labs or some institutions, it's the culture.
- 9:58They use R for example, if they do a lot of genomics, for example, everybody's using R.
- 10:03And then it's okay because then you leave the course, the introduction, then everybody around
- 10:07you can help.
- 10:07But at our institute, I did run some software carpentry course.
- 10:11And it's hard, the uptake, because we're so diverse in what we do because there's people
- 10:16who do genomics at where I work.
- 10:18And then there's other people who do really just kind of epidemiology type things.
- 10:22And so the range is so difficult, different that the needs are different.
- 10:25So it's a good format, but it doesn't apply for all.
- 10:29That's kind of what I found along the way.
- 10:30Yeah, for sure.
- 10:31It sounds to me like reading some of the stuff you've written and looking through some of
- 10:36the stuff you put out there that we've talked to data science folks and even scientific computation
- 10:44folks who also have maybe some programmers around them or some kind of software stuff going
- 10:52on as well, where most of their work revolves around code.
- 10:56But it sounds to me like what you guys are doing, it's a little bit more like you're
- 11:01scientists out there on your own.
- 11:02And yeah, here's some stuff that you can learn and use.
- 11:05But when you get stuck, you know, you're kind of alone on the internet sort of.
- 11:09Is that right?
- 11:10Pretty much it is that while it'd be nice if we had a big amount of funding to have dedicated
- 11:15people to program and to automate some of our things, it's just not the case that the funding
- 11:20is not all that great pretty much around the world.
- 11:23But so if you're working in one of those places that has that, it's great.
- 11:26But most of everybody else, we just have to, you know, figure it out ourselves.
- 11:31And that's kind of how I learned is just by either I could continue to do this pointing
- 11:35and clicking and realizing the mistakes I was making and not able to reproduce anything and
- 11:40those types of things or teaching yourself.
- 11:42But that's not easy.
- 11:43It's a bit overwhelming, I think.
- 11:44Whereas rather than having not enough resources, I think it can be overwhelming because there's
- 11:48just so many resources for people.
- 11:50And unfortunately, we're strapped for time.
- 11:52And so that's a big stress on people at this more senior level.
- 11:55They just feel they don't have the time.
- 11:56And the students, well, they have a little bit more time.
- 11:59But if their supervisors and the people above them aren't necessarily coding, well, then they
- 12:04don't feel the need as much to learn it because obviously other people got by without it.
- 12:07And so it's to try and for myself, it's definitely, as you have said on your show a few times,
- 12:12it's my superpower, really.
- 12:14It's things that other people just can't even fathom could be answered.
- 12:17I'll just take the data and do a few things in Python and then get them the answer pretty
- 12:21quickly.
- 12:22Yeah.
- 12:22They're like, I don't really even know if we can answer this question.
- 12:25You're like, give me pandas and five lines of code and we'll see what we can do with this.
- 12:29Right.
- 12:30Exactly.
- 12:30Yeah.
- 12:31And part of it is actually not even just the fact that maybe they don't need to do it
- 12:35or learn how to do it, but just know that it's possible.
- 12:38Yeah.
- 12:38And value that in terms of valuing it, I think that's what's interesting is that regardless
- 12:44of what type of science you're doing, in the end, it's all based around computers.
- 12:49It almost doesn't matter what field you're in.
- 12:51You're going to be most of the time dealing with data.
- 12:53And so to be able to do that in a repeatable, efficient manner, as you always say, computers
- 12:59are really good at that, the mundane, repetitive tasks.
- 13:01Yeah.
- 13:01So why not automate it?
- 13:03People are noticing.
- 13:05And I think there's a push that even from the senior people, even though they might
- 13:08not know, I think they see that, okay, that's, this is where it's going.
- 13:11Yeah.
- 13:11That's a little bit challenging when the incentives don't necessarily line up.
- 13:15Right.
- 13:16The, the experienced folks, they're busy.
- 13:19They've got stuff to publish and research projects.
- 13:21They'd like to learn, but at the same time, you know, they've got a job, they've got a family
- 13:26or whatever.
- 13:27Right.
- 13:27They've got classes to teach or people to mentor in their field.
- 13:31So that makes it really challenging.
- 13:33I think as well.
- 13:34Yeah, no, it's, it's, the pressures are very high and this whole publisher perish thing,
- 13:39although some people throw it around as a joke, it really is true, unfortunately.
- 13:42And it's in that model where, you know, rather than focusing on good science, that's reproducible
- 13:49that, you know, that's what you expect.
- 13:51When I was a kid growing up, these scientists are just, you know, these amazing people that
- 13:55wear white lab coats most of the time you would think, and that are just extremely careful.
- 14:00And I think we're just people trying to get by and, you know, the incentives make it that
- 14:05we do have to do a lot of work.
- 14:07And a lot of times we might cut some corners.
- 14:09It's just the way it is.
- 14:10We just have to get a lot out there.
- 14:11And there's a lot of pressure to do that rather than take a bit of time and either do it carefully
- 14:16or learn some new ways to make it last a little bit longer in terms of I can pass on
- 14:20my data with the code and somebody else can reuse it.
- 14:22Later on, my future self, I can reuse it or convince myself or convince others that, hey,
- 14:28this was actually the real answer kind of thing.
- 14:30Yeah.
- 14:30I'm having a hard time even coming up with an example where you're doing research and there's
- 14:37not a lot of data to be processed.
- 14:39You know what I mean?
- 14:40Yeah.
- 14:40Yeah.
- 14:41Like, what field is it possible?
- 14:43Like, well, we have seven things.
- 14:44We're going to study these seven.
- 14:46I'll just put them on a line or like almost anywhere that people are doing research now,
- 14:50there's so much data available that you can collect in whatever way, whether it be economics,
- 14:55you can just go load up all the data about all the economies and all the purchasing and habits
- 15:00and whatnot.
- 15:01Or, you know, if you're doing neurology, you can, the amount of EEG data or whatever is ridiculous.
- 15:08Right.
- 15:08So it seems like programming is a really important skill just to almost be functional these days.
- 15:13Well, definitely.
- 15:14And I think that in this, for myself, it actually started with, first, it was a bit of electronics.
- 15:19And I didn't know anything about that, obviously, being a physiotherapist.
- 15:22And I ran into trouble.
- 15:23And then I almost stalled my PhD for, was it six or eight months just because of a simple
- 15:28wire, a couple of wires that needed to be soldered together and connected.
- 15:32And nobody where I was from knew anything about that.
- 15:35And it took a long time just to find the right person.
- 15:37And I was like, never again am I going to have to be not self-sufficient.
- 15:42So I taught myself electronics.
- 15:43And then I think with programming, it was the same thing is that you can find the right
- 15:47people.
- 15:47But either it's going to take time and money.
- 15:50And it's not always if they're not exactly in your field, they'll do their best.
- 15:54And then it's going to be multiple iterations to get to the final what you would like.
- 15:57And you don't even understand how it got there.
- 15:59So I think this idea of learning just enough to get you by really is quite valuable.
- 16:03And as you go, the learning curve, although it's Python and it's obviously easier than other
- 16:07languages, if it's not your thing, it's a big learning curve.
- 16:11The ideas of programming at the same time, you don't want to just learn programming.
- 16:14You want your results.
- 16:15That's number one.
- 16:16So you're juggling all these things.
- 16:18But once you get over that curve, the big learning is done.
- 16:21And then it's just adding on for each new project.
- 16:23You might learn a new technique.
- 16:24You might learn, oh, now I'm going to use databases or now I'm going to learn Git and
- 16:28now version control my code and things like that that come along.
- 16:31So it's how to do it progressively, not get intimidated and not just say, oh, I'm going
- 16:35to go back to my point and click programs because at least I can get the results quickly.
- 16:38Exactly.
- 16:39Or Excel.
- 16:40Yeah.
- 16:40Yeah.
- 16:41Excel.
- 16:41I try not to use that word and it's not my, I have a fear.
- 16:45Yeah.
- 16:47I have an allergy to be honest.
- 16:48I walk by the people who have those screens open and I, oh, I just, yeah.
- 16:51Yeah.
- 16:52I don't, I personally have this thing about Excel and science.
- 16:54It just really, for more than just a simple, you know, keeping a few numbers or doing some,
- 16:58you know, basic adding or addition or stuff like that.
- 17:01It's fine.
- 17:01But it really, I mean, it just doesn't have a place in my opinion nowadays.
- 17:06So, yeah.
- 17:08Well, I think the problem is like, it's fine for the simple case.
- 17:11Like I use Excel for accounting and the stuff that we do.
- 17:15And it's, it's great.
- 17:16It's got to take a few numbers.
- 17:17It's got to add this column and it's got to divide by that and put, you know, 20% over
- 17:21there.
- 17:21I don't know what, something like that.
- 17:22Right.
- 17:22That's fine.
- 17:23We did a whole episode on Excel with Chris Moffitt, episode 200, escaping Excel hell with
- 17:29Python and bandas.
- 17:31And that was a lot of fun.
- 17:32One of the things that dawned on me that really makes these worksheets in Excel or any, you
- 17:38know, could be Google sheets.
- 17:39It's really no, no difference.
- 17:41That makes it really tricky is it's kind of full of go-tos.
- 17:46You know, when you, when you have a formula that's down here in like a 32 and then it says
- 17:53add stuff over there and then make this decision and then take that from over here.
- 17:57And then there's a formula over there.
- 17:58It's like, there's no way to look at it and tell what order that it flows.
- 18:03Right.
- 18:03It's just go here and go there, then go back over there, then take some of this.
- 18:07And yeah, it's just, it seems like it takes some of the worst practices when you try to
- 18:11push it too far.
- 18:13Yeah.
- 18:13I think if it fits on a page and, and you've got a few pages, I think, you know, and everything
- 18:18is self-explanatory.
- 18:20I'm okay with that.
- 18:21And, you know, even though I've done that for a survey that I published with one of the papers
- 18:25that I wrote and it was the best way to present it.
- 18:27But when you've got a lot of those embedded formulas, I, as a person opening it, have no
- 18:33idea what's the flow of all of this and the bigger they get.
- 18:37And that's, you know, there's research that's been done and people who've analyzed Excel spreadsheets
- 18:42is that for every hundred things that you do in Excel, there's going to be approximately
- 18:46five errors.
- 18:47And the more complex it is, the more likely you're going to make these mistakes.
- 18:51And I think the hardest ones are, for example, the one that came across in some of the data
- 18:55that I was involved in, I asked to see it this, for example, take the average, because
- 18:59we did three responses from somebody, take the average of the three.
- 19:02But what happens is there's a missing data point.
- 19:04Well, just by default, from what we did, Excel puts a zero.
- 19:07So now you're averaging two numbers with a zero.
- 19:10And it was just, but you had to search through it.
- 19:13And it was like in, you know, page number eight on, you know, this II52.
- 19:17And they're very difficult mistakes to find.
- 19:19Whereas coding, if it's done, you know, if you choose your variable names well, and you
- 19:25do a bit of documentation, it can almost read like a story.
- 19:28And you can, even somebody who can't code necessarily can at least follow and kind of, or you could
- 19:33just sit down with them and just tell them the story of the code.
- 19:36And they might be able to say, that doesn't make any sense.
- 19:38Yeah.
- 19:38Yeah.
- 19:38Wait, you're doing this wrong, right?
- 19:40Whereas Excel is much more nebulous.
- 19:42Yeah.
- 19:42It's very vague.
- 19:46This portion of Talk Python To Me is sponsored by Clubhouse.
- 19:49Clubhouse is a fast and enjoyable project management platform that breaks down silos and brings
- 19:54teams together to ship value, not features.
- 19:56Great teams choose Clubhouse because they get flexible workflows where they can easily customize
- 20:01workflow state for teams or projects of any size.
- 20:04Advanced filtering, quickly filtering by project or team to see how everything is progressing.
- 20:10And effective sprint planning, setting their weekly priorities with iterations and then
- 20:14letting Clubhouse run the schedule.
- 20:16All of the core features are completely free for teams with up to 10 users.
- 20:20And as Talk Python listeners, you'll get two free months on any paid plan with unlimited users
- 20:26and access to the premium features.
- 20:27So get started today.
- 20:29Just click the Clubhouse link in your podcast player show notes or on the episode page.
- 20:33So you wrote a blog post called Errors in Science.
- 20:38I make them.
- 20:38Do you?
- 20:39Part one, two, three.
- 20:40And I'll link to part three.
- 20:43And one of the things I found amusing from there was you actually linked to an article which
- 20:48talks about the 12 of the biggest spreadsheet fails in history.
- 20:51Do you remember that article?
- 20:54Yes.
- 20:54It's pretty scary.
- 20:56And I mean, in our case, well, I guess it could some of these mistakes, you know, they
- 21:00lead to in science lead to retraction with the biggest problems would be that.
- 21:03And that's kind of a big embarrassment and something we don't want to do.
- 21:06Right.
- 21:06And other people can write based their conclusions on a paper that then has retracted.
- 21:11So it's kind of a bit of a house of cards as well.
- 21:13Exactly.
- 21:13You know, and unfortunately, some people, even though it's retracted, some people continue
- 21:17citing the original one, which is, you know, you're not supposed to do, but people
- 21:20haven't realized it's been retracted.
- 21:21So it's a bit of an issue.
- 21:22But some of the other ones that, you know, if you do this in the financial industry,
- 21:26that there are some companies that, you know, very simple Excel mistakes have led to, you
- 21:30know, millions and millions of dollars being lost.
- 21:33And so, yeah, so that article just kind of highlights the some of the worst.
- 21:37And the European Union actually has a whole kind of group that's working on this and dealing
- 21:43with how can we improve these practices with regards to spreadsheets because the mistakes
- 21:48are so costly.
- 21:49Right.
- 21:49I'll just read just a couple because I think they're kind of amusing.
- 21:53Hans Alta, a Canadian company, made a cut and paste error in their spreadsheet and it cost
- 21:58them $24 million where they caused them to buy.
- 22:03They bought some U.S. power transmission hedge contracts at the wrong rate.
- 22:08Fidelity, their Magellan fund, which is like an investment mutual fund type fund thing.
- 22:14They had to cancel a $4 per share dividend because they had a missing minus sign.
- 22:20So they thought they made a profit instead of a loss.
- 22:22MI5, the British spy agency, actually bugged over a thousand wrong phone numbers.
- 22:29There's just like all these weird errors.
- 22:32Anyways, a really fun read for people that get, you know, sucked into that world.
- 22:37So there's the drag and drop lab view type stuff, which is not that great.
- 22:41There's some just not very much programming skills at all.
- 22:44Maybe a little MATLAB.
- 22:45There's trying to over leverage Excel.
- 22:48A lot of these could be fixed by, you know, a little bit of Python, a little bit of pandas
- 22:53or, you know, whatever library it is that works with the type of data that you're using.
- 22:57Right.
- 22:58Yeah.
- 22:58And I think with Python, it's the fact that, and you've mentioned this yourself, it's just
- 23:03the Swiss army knife.
- 23:04It's that MATLAB has a license and its application is very, you know, engineer, math and science
- 23:10focused.
- 23:11Whereas Python, I had a master's student who came and finished with us.
- 23:14And I kind of, his first study, he programmed with me.
- 23:17Second study, he did most of it.
- 23:20And I just looked over shoulder and made sure everything was okay.
- 23:22But he went on now and he's working.
- 23:24You know, in a sense, he's got a new superpower is that it's universal.
- 23:28He can use it for such a variety of things.
- 23:30That's not specifically for science.
- 23:32So while it's obviously great, the learning curve isn't that steep if you've got a bit
- 23:37of time and it's just so diverse rather than some of the more specialized languages.
- 23:42So I think as an introduction, Python, I mean, it really, it's so simple, easy to read.
- 23:47And it's a new skill.
- 23:48That's kind of how I sold it to the institute where I work at here in Australia is they were
- 23:53looking for ideas for almost like a vision for 2022 or what.
- 23:58And I just said, well, wouldn't it be great if we could advertise that every student that
- 24:02comes and does a PhD with us will have basic skills in at least one programming language
- 24:07when they leave.
- 24:08And they thought that was a great idea.
- 24:09So that's how I pitched it that, you know, in this day and age, it's got to be part of the
- 24:13education, not simply the, you know, sitting at the workbench or working with spreadsheets.
- 24:17Yeah.
- 24:18Something you just have to pick up in your spare time as part of your research project
- 24:22or whatever.
- 24:22Be better if it was more, right?
- 24:24Because we have tons of spare time when we're doing our PhDs.
- 24:27It's evenings and weekends.
- 24:29And it's the few of us who are, you know, a bit silly enough to do it, bit hermits.
- 24:33And we just do it on our own because we just feel the need to do it.
- 24:36But yeah, a lot of other people, you know, sensibly don't do it.
- 24:38And that's fine.
- 24:39But I think in the long term, if it's become more acceptable and it's actually presented
- 24:43right from the beginning that, hey, this is how it is.
- 24:46You're going to learn a bit of programming to learn a bit of this.
- 24:47It just becomes part of the learning process rather than when you just, it would be nice
- 24:52if you learned it, but there's no structure.
- 24:54We're not going to teach you and I'm not going to point you to any resources.
- 24:57That's difficult for a lot of learners.
- 24:58Yeah.
- 24:59Well, I think it's a great service to offer that to your students, right?
- 25:03To say, you're going to learn whatever it is you're here to study and get your master's
- 25:08degree in or whatever it is.
- 25:10And also you're going to have this programming skill in the context of that, because I'm sure
- 25:15that if you go out there and apply for a job and there's 10 people, probably more, but let's
- 25:21say there's 10 people apply.
- 25:22Two of them also have good programming skills that are relevant to that in addition.
- 25:26And all things being equal, like that's down to two candidates.
- 25:30You know what I mean?
- 25:30Yeah.
- 25:31So it's really great.
- 25:32Now, one of the things you did that I'd like to just chat a little bit about, I think is
- 25:37interesting, is you did a survey around scientific computing at your institute, right?
- 25:44Yeah.
- 25:44So yeah.
- 25:44So let's talk about that a little bit.
- 25:46What was the survey trying to get at and what were some of the results?
- 25:49Well, after I pitched this idea of training, obviously I have some ideas.
- 25:53I'd done the software carpentry teacher training.
- 25:56So I had my own opinion of how it all should work.
- 25:59But again, who am I to say how everything should run and what are the needs of the people?
- 26:03Especially because where I work, there's people who work on cells.
- 26:06Some people work on epidemiology.
- 26:08Some people work on human research.
- 26:09And the fields are as different as schizophrenia, falls in balance, people with vestibular issues.
- 26:15We study the gamut.
- 26:15And so rather than impose what I thought people would need, I just said, hey, you know, we've
- 26:20got these easy survey online things to do nowadays.
- 26:23So how about I just create a little survey, get some information because I'm a scientist.
- 26:27I like data.
- 26:27So I just said, let me get some data so I can make informed decisions.
- 26:30And also it allows me to track.
- 26:32If I were to continue this over time, I'd be able to see how people are changing.
- 26:36So it was a variety of questions based on, you know, what field are you in?
- 26:39What's your level of training or education?
- 26:41And currently, what are your current practices?
- 26:44And then looking at in terms of what would you want to learn?
- 26:47How would you want to learn that?
- 26:48And those types of questions.
- 26:49Right.
- 26:50So I sent out the survey.
- 26:51Our institute, I can't really say the number right now.
- 26:54It's probably where we're now above 200 people for sure.
- 26:57I think depends on how many of the students are present, but it's a biggish institute, but
- 27:01not all that big.
- 27:01But we had 80 people respond.
- 27:03And it was nice because senior scientists replied, senior postdocs, postdocs, students, and a
- 27:08few staff as well.
- 27:09So the responses kind of reflect a bit of everybody.
- 27:11And so that was kind of nice.
- 27:14And yeah, it's good.
- 27:15As you might expect, we're not, you know, it's not, it's not all that surprising that
- 27:18pretty much everybody analyzes data with computers.
- 27:20There's some that don't.
- 27:22And I would have to say, well, it's possibly some of the staff and also some of the senior
- 27:26people.
- 27:27It's kind of why I don't want to become the most senior scientist, because at some point
- 27:30you almost stop looking at the data.
- 27:31You entrust the pyramid of senior postdocs and postdocs and students to handle the day-to-day
- 27:38data.
- 27:38And so they kind of don't do that.
- 27:40But most people, as part of their job at some point, manage.
- 27:44Some form of data.
- 27:45So it is a useful, it's just become, this is what we do.
- 27:48We manage with data.
- 27:49And most people want some form of training or knowledge.
- 27:53And I guess one of the unsurprising, as we were talking before about Excel, is that most
- 27:58people, 80% or so, do stuff with Excel.
- 28:02And that's okay.
- 28:03But what's surprising to me, and I guess because Excel is even easier to pick up, is the fact
- 28:08that nobody's actually got, most people, 20% only had actual training, had done a course
- 28:12of some sort with regards to Excel.
- 28:14Yeah.
- 28:15I think people think Excel is easy.
- 28:16In some sense, it is easy.
- 28:18But that can be a really advanced tool.
- 28:21When I was in college, I took a course on basically like spreadsheets.
- 28:26And man, back in the day, it was like Lotus 1, 2, 3, and all sorts of random things that aren't
- 28:30really around anymore.
- 28:32But I remember learning, I felt like I can use Excel, I can load data, I can do formulas,
- 28:38whatever.
- 28:38Like, there's a lot to learn about stuff that you can do in there.
- 28:41So that's, you know, that only one out of five get any real instruction on it.
- 28:46That's surprising.
- 28:47Yeah.
- 28:47And, you know, I have a colleague who went off and kind of did an online course for Excel.
- 28:52And, you know, he came back and everybody was really impressed.
- 28:54And just, he was showing everybody new things.
- 28:56And so, done properly, as he was doing it, I could see that, okay, it's not as bad as I
- 29:02used to picture it.
- 29:03But unfortunately, he's one out of, you know, everybody I've ever come across.
- 29:07And so, really, the majority of people are just think it's just point, click, add some
- 29:11numbers, try a few things.
- 29:12But, yeah, there's not much education behind it.
- 29:15And I think what's interesting also in the survey, I asked about other tools.
- 29:19So, for example, you know, we do a lot of data management or statistics.
- 29:22And there's obviously the typical point and click programs.
- 29:26And a lot of those have the equivalence.
- 29:28But for, you know, you could do that in programming, is that many more people were using point
- 29:32and click programs.
- 29:32than people who would program.
- 29:34Yet the ones that programmed always had more training.
- 29:37Just because, obviously, to learn it, they had to do some form of training.
- 29:40This is the point and click.
- 29:41It's the problem that it's just, it's deceptively simple.
- 29:44And I think statistics is one of those areas that, you know, I think a lot of people have
- 29:48allergies to for some reason in science.
- 29:50I kind of like them myself.
- 29:51I think they're important.
- 29:53And you got to understand them.
- 29:55But with this point and click stuff, a lot of people just kind of click some buttons,
- 29:59think it's okay.
- 30:00And then this big output comes out with sometimes some figures.
- 30:03A lot of times these big tables.
- 30:04And they're difficult to interpret.
- 30:07And yet some people just say, oh, where's my p-value in there?
- 30:09And then they're just like, great, this one worked.
- 30:11And if it didn't, well, you know, maybe click a few different buttons and see if the answer
- 30:15changes.
- 30:15Which is obviously not great science, but it does happen.
- 30:18Whereas with programming, it's, you kind of have to know what you're doing from the get
- 30:22go.
- 30:22And so there's a lot less chance of that just kind of what people would call p-hacking.
- 30:26It's just searching for and trying permutations of it until you get something that, oh, that
- 30:31looks better or what I was expecting.
- 30:32Yeah.
- 30:33Well, if you're going to wire stuff together and push buttons, like it's almost always going
- 30:36to give you an output, right?
- 30:37So yeah, well, there's the answer, right?
- 30:40Well, in programming, you kind of got to really think through it and line it up.
- 30:43Or it's not going to give you an output, it's going to give you an exception, you know,
- 30:47a traceback or something, right?
- 30:48Yeah.
- 30:49And I think the value of programming, for example, in those contexts, and it's one of those things
- 30:54I'd never even thought of.
- 30:55Now I do it almost all the time is that if I'm using a new statistic or I'm using a new
- 31:00program to analyze my data, why risk putting in my own data that I spent all this time putting
- 31:06in and hoping that I'm doing it right to get an answer rather than generate, which is quite
- 31:10simple nowadays, generate some data that I know the answer to.
- 31:14So, you know, simulate the data and put in some artifacts or put in a certain trend.
- 31:18So it will give me a statistical result, run it through.
- 31:20And is it as expected?
- 31:22If so, great.
- 31:23Then I can apply that to my actual hard earned data.
- 31:26And I can kind of trust the data and the results a bit more versus other than that.
- 31:31I'm sure there's people out there who work with statisticians on a day to day basis.
- 31:34There's other people who themselves are quite competent, but my experience has been a lot
- 31:39of people, a lot of labs, not everybody, but a lot of us kind of just do that.
- 31:43We just collect data, put it in the program, fiddle about with our own data, and in the
- 31:47end, see what kind of comes out that makes sense.
- 31:49And hoping in the end, it's a hope that, okay, I think I did it right.
- 31:52Yeah.
- 31:52But it's pretty risky in terms of, you know, this is science and we're going to publish
- 31:56it, make it publicly available.
- 31:57So yeah, it was a bit of an eye opener in terms of, but what was nice is that my survey
- 32:02highlighted that, okay, this is what people are currently doing, but what do people want
- 32:07to do?
- 32:07Are they interested in it?
- 32:08And yeah, there was definitely a big interest in learning these skills.
- 32:12One of the questions was about, do you think how valuable is it to have computer coding as
- 32:17a skill currently?
- 32:18And the average was, it's important.
- 32:21And then the next question was, how is it for the future as a young, as a young investigator
- 32:26in the future career?
- 32:28How important is it?
- 32:29And it was very important.
- 32:30So it's highlights the fact that there's this shift to even the fields that may historically
- 32:34not have incorporated coding into their education of their students are now seeing that, yeah,
- 32:39well, maybe I don't do it as a senior or a postdoc.
- 32:42But I think that for the future, even those people are acknowledging that it's valuable.
- 32:46But as you might expect, one of my questions was trying to understand what would they want?
- 32:51But most importantly, in a sense, what are the biggest problems?
- 32:54Why aren't you coding right now?
- 32:55Why aren't you learning?
- 32:56And what are the obstacles?
- 32:57And some of them are addressable.
- 32:59Like lack of institutional resources.
- 33:01Like you could have more of that.
- 33:03Or you could have more examples.
- 33:04But one of the biggest one in that area that you got for your survey was lack of time.
- 33:10And it's hard to help people make more time.
- 33:12Exactly.
- 33:13I wonder whether that's a real problem or it's a perception.
- 33:17I think that for people who, like myself, when I first got introduced to coding, it's the unknown.
- 33:23And you think, my God, that's going to take me, you know, a year of my time.
- 33:27Right.
- 33:27These are like the wizards of Silicon Valley that like create this magical digital world around us.
- 33:33And it's like engineering plus with all the math and everything.
- 33:37It seems so hard from the outside.
- 33:40And then you do it.
- 33:41You're like, oh, that's all?
- 33:42Well, that was not so hard.
- 33:43Right?
- 33:43I just called this library.
- 33:44Exactly.
- 33:45With all the new tools, it makes it much simpler.
- 33:48My one piece of advice to students or people who come and ask me about these things is just pick one task in your next study.
- 33:54Don't do the whole thing.
- 33:55Just pick one thing.
- 33:57Whatever you, if it's about the acquisition of the data or if it's just making your figures.
- 34:02Or cleaning up the data.
- 34:03Yeah.
- 34:04Just pick one thing that you can automate.
- 34:06And if you want, I can help you along.
- 34:09Just do one step.
- 34:10And it makes it so different than if you're learning from a book that's giving you examples about, I don't know, leeches or the economy or some other problem that doesn't relate to me.
- 34:19Whereas this one, I'm actually building, using my learning to actually help me out.
- 34:24You're going to find a solution because in a sense you have to.
- 34:27But it's not daunting because you're not going out and learning everything that you need.
- 34:31I'm not setting up a web page to present my data or to do a survey or whatever it is.
- 34:35Just pick a simple, biteable chunk and then on your next study, just add to that.
- 34:40And then you'll see.
- 34:41That's really good advice.
- 34:42Yeah.
- 34:42Yeah.
- 34:42I think that's why the lack of time, I think, is they think they have to just stop and learn.
- 34:47And that's just not feasible.
- 34:49Right.
- 34:49I got to redo the way I do everything.
- 34:51We're going to rewrite this whole thing.
- 34:52Yeah.
- 34:53Yeah, exactly.
- 34:53Like, there's a bunch of little steps.
- 34:56You know, I would say, what is the step that makes you the least want to work on this project?
- 35:01You know what I mean?
- 35:02Like, what is the most not fun thing you do?
- 35:05Could you automate that?
- 35:07Yeah.
- 35:07And I guess the other one I've done for myself, actually, one of the big pushes to do Python,
- 35:12especially for data acquisition, for some of the research I do, is a lot of taking responses
- 35:16from other people.
- 35:17And we do these perceptual illusions to know where your body is in space.
- 35:21And we always have to get the answer.
- 35:24And for me, it was after we were done these studies, the first few times I participated
- 35:28in them and helped out, is once you look at the data and there's an outlier or a few points
- 35:33that you're just like, that can't be right.
- 35:35But then what do you do?
- 35:36You go back and it's a piece of paper.
- 35:38And then it's a number that I wrote.
- 35:39And then I'm like, well, did I write it wrong?
- 35:41Or did the person, you know, did I not understand what they were saying?
- 35:43Or their accent might have been different.
- 35:45And then you try to follow the chain and you're always, and I hated that because I had no real
- 35:49reason to exclude the data based on a known error.
- 35:53And that just frustrated me.
- 35:54And it happened enough that I kind of built this system around testing these things that,
- 35:59you know, it's all computer.
- 36:01It's built around, well, Python with a bit of Pygame on top for the interface.
- 36:06And in that way, now the data goes straight into the computer.
- 36:09Each response is verified with the person who's given me the answer.
- 36:13It shows it to them and says, is this actually what you answered?
- 36:15And it's just saved so much trouble.
- 36:18And now our study we just did had zero data that was even in question.
- 36:22And so we've gone from a lot of stress and possibly a few data points that were wrong to now I live in peace that after the study is done.
- 36:30And, you know, we get good, surprisingly, as experimenters.
- 36:33If you do it over and over, you kind of, it's less stressful to run the experiments.
- 36:36I can kind of think on my feet.
- 36:38But when it's the students and it's their first time running an experiment, they're pretty stressed out.
- 36:42There's a lot to think about.
- 36:44And you could see how easily they could forget to, you know, to check something or to write something down that's not correct.
- 36:49And then they go and, you know, copy paste that into the computer.
- 36:52There's so many levels of errors that can happen there.
- 36:55So for myself, part of it was early on the lowest hanging fruit.
- 36:58But that one was one I had to tackle because I was just so insecure.
- 37:02I didn't feel good about the fact that I just don't know.
- 37:05I mean, I think, let's say, 95% of my data is right.
- 37:08But can I get it to close to 100?
- 37:10And I think we're nearing that.
- 37:13And I think it was a big undertaking.
- 37:15But now the system's there and we've used it multiple times over.
- 37:18And, yeah, so you have to pick what's most important or, as you said, what's the most annoying job that you have to do.
- 37:24And data entry for us was one of the huge ones.
- 37:26Nobody wants to do that.
- 37:27That's boring.
- 37:28And so, yeah, just do it on the fly.
- 37:30And then the computer does it perfectly every time as long as you, you know, again, test your code and make sure it's doing what you expect, which is a whole other story that we might get into.
- 37:39Yeah, we should get into that as well.
- 37:41But at least, you know, it's as long as the software is working right, it's the foundation, right?
- 37:46Your data is the foundation of your research, which is the foundation of your papers and your work.
- 37:53And you definitely want that to be right.
- 37:55So if you can automate that.
- 37:56This portion of Talk Python To Me is brought to you by Linode.
- 38:01Whether you're working on a personal project or managing your enterprise's infrastructure, Linode has the pricing, support, and scale that you need to take your project to the next level.
- 38:10With 11 data centers worldwide, including their newest data center in Sydney, Australia, enterprise-grade hardware, S3-compatible storage, and the next-generation network, Linode delivers the performance that you expect at a price that you don't.
- 38:25Get started on Linode today with a $20 credit and you get access to native SSD storage, a 40-gigabit network, industry-leading processors, their revamped cloud manager at cloud.linode.com, root access to your server, along with their newest API and a Python CLI.
- 38:41Just visit talkpython.fm/Linode when creating a new Linode account and you'll automatically get $20 credit for your next project.
- 38:49Oh, and one last thing.
- 38:50They're hiring.
- 38:51Go to linode.com slash careers to find out more.
- 38:55Let them know that we sent you.
- 38:55I do want to come back and ask you a question about this importance of learning computer programming for the future grad students and whatnot.
- 39:05One of the things I think is interesting here is probably that means people are seeing more and more data that they need to work with.
- 39:14That's probably one angle I would suspect that's pretty straightforward.
- 39:17I wonder another one about just almost like sort of grant money angles as well.
- 39:25Because when you're a new grad student or postdoc, maybe you don't have a grant yet.
- 39:29Maybe you don't have a lot of resources.
- 39:31And with things like Python and the SciPy space and whatnot, you know, it doesn't matter if you have money or not.
- 39:38You have some of the best computational tools in the world.
- 39:41Those ones that people used to find black holes and work from the Higgs boson and whatnot.
- 39:46And you get those tools for free as well.
- 39:49What do you think about that angle?
- 39:50Yeah, well, I mean, for us, it's actually that's the truth is that there's things that I wouldn't have been able to do.
- 39:56Some of it is going data mining on our own data that we've accumulated.
- 40:00And I'm about to do the same thing with a colleague of mine that I write a blog with.
- 40:04We're going to go data mine three different data sets that have just been laying there that have a piece of information that would be really useful together, especially.
- 40:12That, you know, doing it by hand or by Excel, which is I think it's an insurmountable task.
- 40:17But programming makes that possible.
- 40:20And then the other thing is, as you mentioned, a lot of this move for all of science and funding agencies, especially, are asking people to make their data public.
- 40:27Some journals also ask to put your code public.
- 40:30So now, really, you have access to all these things that maybe I can't collect this data.
- 40:36Maybe I can't do this, but I have access now.
- 40:39I can download it.
- 40:40I can search through it.
- 40:41I can ask new questions on old data.
- 40:43Right.
- 40:43Get their Jupyter notebook and their data, and then you can start thinking from there, right?
- 40:49You can start exploring and changing it and slicing it differently and trying to make discoveries, right?
- 40:53Yeah.
- 40:54And I think that's the whole push towards open data is when you do clinical studies, for example, clinical trials to see if an intervention works.
- 41:01Well, that's important.
- 41:03But then, really, it's the meta-analysis, the thing that puts it all together.
- 41:06And so that push for people to present the data in their papers in a way that could be useful for scientists who do science on science.
- 41:14They analyze all the studies, put them together and say, overall, the evidence is this.
- 41:19Well, similarly, I think this is where coding and open data can help is let's not reinvent the wheel.
- 41:25And some of these data sets can be combined or they can be just searched.
- 41:29And by people who have completely different ideas that you'd never thought of, but somebody is going to go out there and just either contact you or just themselves, just move on with that data.
- 41:37And I think just progress will happen a lot faster and more efficiently.
- 41:41And that kind of research, as you're pointing out, doesn't really need any grant money.
- 41:44I mean, you can work on a fairly cheap machine and just get the data and try out a few things.
- 41:49And I think that's where it's going to, definitely.
- 41:51Big data, but big collaboration as well.
- 41:53Right.
- 41:53It needs time, but it doesn't need money for resources potentially, right?
- 41:58Yeah.
- 41:59It's a culture change because of the incentives.
- 42:01There's a lot of incentive to be exclusive.
- 42:04I own this data set.
- 42:06I'm the one who collected it.
- 42:07And my group pushes these results out.
- 42:10And I don't want to be scooped by anybody else, for example.
- 42:13Some of that I can understand.
- 42:15Right.
- 42:15There's still discoveries to be made in this data.
- 42:18And here's our first one.
- 42:20Yeah.
- 42:20But we're hanging on to it for the rest, right?
- 42:22Which is, yeah, I understand that.
- 42:23That might be a hard thought to get that.
- 42:25Yeah.
- 42:25And so I think it's a culture change that way.
- 42:28It's a gradually, I think, that people will be more transparent.
- 42:31And hopefully, you know, and you can see putting an embargo saying, you know, we'll make it public,
- 42:36but in a certain amount of time.
- 42:37But at some point, but the competition for these things is quite high.
- 42:41So therefore, you can see why some people like to kind of hoard their data a little bit and
- 42:44not necessarily make it publicly available.
- 42:47But the move is for a lot of the top journals to require people to put their data in some
- 42:51form on public repositories.
- 42:53So the move is there.
- 42:54And if you're funded, actually, a lot of funding agencies in Europe, and I think the NIH has
- 42:58some of these policies, is that if you're funded by us, well, you're going to make your data
- 43:02available to others.
- 43:03Right, right.
- 43:03This is ultimately paid for by the taxpayers.
- 43:05This is not yours.
- 43:06So share.
- 43:08Exactly.
- 43:08Right.
- 43:09Similar for open publication is that, you know, we're giving you the money to do this.
- 43:12Therefore, when you publish, you have to publish in open source journals, or you're going to
- 43:16pay the fee to make it an open publication within that paywall journal.
- 43:20So those are similar in terms of the move towards open science.
- 43:23Sure.
- 43:24Well, one of the interesting things that you've written about, and I think it comes back to this
- 43:30sort of, which comes first, but one of the challenges is the life cycle and the openness
- 43:38or the lack thereof of the data and the algorithms and the libraries for science is not necessarily
- 43:46the same as for random software project by software developers, right?
- 43:50Say versus Flask, right?
- 43:52You talked about some of the important lessons that people in the science space can take from
- 43:57the computer science side of things, things like GitHub and issue tracking and whatnot.
- 44:01Do you want to talk about that a bit?
- 44:02Well, it's computer science.
- 44:04And I was always thought, why is that called a science?
- 44:06Really?
- 44:06Aren't they just, you know, nerds or geeks on the computer?
- 44:09And I had that false perception, obviously.
- 44:12And now I'm kind of one of those people myself to some extent.
- 44:15But when I was starting out, it was all just, isn't it just a mishmash of they're just typing
- 44:19and there's no rhyme or reason about it.
- 44:21And to be honest, it's kind of interesting.
- 44:23I coded MATLAB for the longest time and I had so many misconceptions.
- 44:28My code was, my PhD code was two scripts that were, you know, and I thought it was cool
- 44:35that I had like 3,000 some lines of code.
- 44:37Yeah.
- 44:37I had so much copy and paste.
- 44:40It was very embarrassing.
- 44:41I don't want to go back to that because I just didn't know any better.
- 44:44And the people who taught me didn't know any better.
- 44:45Right.
- 44:46Nobody said, what are you doing here?
- 44:47They're like, well, that looks like mine.
- 44:49So this must be fine.
- 44:50Exactly.
- 44:51Yeah.
- 44:52So it's just an inheritance.
- 44:53It's just this, unfortunately, the natural selection is in the wrong direction in this case.
- 44:57So gradually, you know, I read up more about it.
- 45:00Software carpentry pointed me in a good direction.
- 45:02And then I read some books.
- 45:04I fell upon your podcast and then Brian Okken as well.
- 45:08And I started realizing that all this stuff has already been figured out, which obviously
- 45:13is obvious.
- 45:13People have figured this out in, you know, a long time ago in the 70s, 80s.
- 45:17And up till now, it's just so much simpler.
- 45:20The workflow, all the things like GitHub with making suggestions or changes and all those
- 45:25kind of things, pull requests.
- 45:27Right.
- 45:27You put your code up there.
- 45:28Somebody will find, if they find something wrong, they'll put an issue in there.
- 45:32If they can fix something or improve something, they'll do a PR.
- 45:35And it's, you know, science talks so much about this research study is valid.
- 45:42We know the Big Bang happened this way because this is peer reviewed, right?
- 45:46Yeah.
- 45:47And I mean, that's kind of what GitHub is.
- 45:49Just less formally, less credentialed, but in a sense, right?
- 45:53Yeah.
- 45:53But what's interesting there is I spoke to, we have a floor meeting once a week.
- 45:59And just before Christmas, I did talk about this comparison of what we can learn from computer
- 46:05scientists.
- 46:06And that was a bit what I was pointing out was that a computer scientist will write their
- 46:10code and do it as best as they can and then put it up there.
- 46:15And in a sense, not that they expect there to be bugs because, you know, some people will
- 46:19then go to the next step, which is they'll make tests for their code.
- 46:22But there's still this knowledge that there possibly and most likely is a bug of some sort
- 46:28or a case that I've not considered that if you throw it at my code, okay, it'll crash.
- 46:33Whereas, and that's expected.
- 46:34And then when you get a pull request, you're thankful and you say, you know, great.
- 46:38It's not a improving the code.
- 46:40It's actually a fixing a problem with my current code.
- 46:42And it's this iterative process that happens over time for improvement versus in science.
- 46:48And I realize this doesn't speak to everybody out there, but a vast majority of us, if we
- 46:53do code, but even if we don't, we just do our work and then we polish it up into this little,
- 46:59you know, either Word or PDF document that we submit to a journal.
- 47:03And this polished final version has most of the time, no data attached to it.
- 47:08It's just a few figures and some tables gets assessed by two, three other of my peers.
- 47:12And they have no idea that, you know, all the steps that were taken.
- 47:17There is research on this that kind of shows that the number of somewhat arbitrary decisions
- 47:23that are made along the way to collect your data in terms of, okay, well, I'm going to use
- 47:27this versus that.
- 47:28I'm going to exclude these cases versus that.
- 47:30I'm going to use this test or this filter setting versus that.
- 47:32There's so many permutations that in the end, it's almost, of course, you're going to find
- 47:36something significant, but in itself, it's just a self-fulfilling prophecy.
- 47:40You're setting yourself up to find something.
- 47:41And then as the Texas sharpshooter example, it's that thing of the guy who, he's got a barn
- 47:48and there's bullet holes in the barn and there's always a red circle around it.
- 47:53And there's a guy who comes by and he says, wow, do you hit that every time?
- 47:58And he goes, yeah, I'm so good.
- 47:59And then his wife comes out and then she says, he actually just shoots.
- 48:02And he draws a circle around it afterwards.
- 48:04So if you want to find something, you'll find it.
- 48:08And yeah, there's just, I don't want to say that I'm a skeptical about other scientists,
- 48:13but we are one of the people I work with, Simon Gandivia, does a lot of work on cognitive biases.
- 48:19And we have to almost protect ourselves from our own science in a sense, because the people
- 48:24doing it aren't the computers, it's us.
- 48:26We have to make the decisions.
- 48:27And without knowing it, we have these, and a bias is that, is that you're not aware of it.
- 48:31Somebody might even point it out to you and you might just not acknowledge that it's there.
- 48:36You might think that doesn't apply to me, but I know other people that it applies to.
- 48:39And so we just have to come up with ways.
- 48:41And I think that coding, making decisions before the data comes in and making it transparent,
- 48:46it's one of the ways that we can improve what we do.
- 48:48And so in terms of things that we can learn from computer scientists, I think, for example,
- 48:53the push towards publishing the data and the code, it's so interesting because once we publish it,
- 48:58if I make that, it's a big stress on people.
- 49:01Currently, it's almost like some people don't even make an effort to clean the data or the code
- 49:05because they don't want anybody to use it.
- 49:06Right, right.
- 49:07Just leave it totally obscure and like, well, I have no idea what this does.
- 49:11And the variable names are bad.
- 49:12And what is this about?
- 49:13And just, ah, forget it, right?
- 49:15That's the hopeful outcome.
- 49:16Yeah.
- 49:16And somebody looked at that as well and saying that I think it's over 80% of the data sets
- 49:20that are out there or code is actually not really useful.
- 49:22But if you think of it from a computer science point of view, well, that's actually almost the
- 49:27start of it, right?
- 49:28Unless you have a very big group and there's been multiple eyes on the code, this might be the
- 49:32first public appearance of this code.
- 49:34And it would be nice if people had the chance to look at it, run it a few times, figure out
- 49:39if there's any issues.
- 49:40But the risk of that, the way the current publishing system works is that if anybody finds a genuine,
- 49:45not more just, not a little error, but anything that's of significance, that means the paper
- 49:50probably will need to be retracted, which is a huge deal in science.
- 49:53Right.
- 49:53Versus in computer science, well, sure, put a pull request and I'll fix that for you.
- 49:58They're humble enough to know that I'm not perfect.
- 50:01There's going to be things, I may have made a mistake in this versus in science, it's what
- 50:05we publish and we just want to move on.
- 50:07We want to just, you know, that thing's something on my CV.
- 50:10I've ticked that box, another number and I move forward.
- 50:13So that's one lesson that I don't know how to incorporate it exactly in terms of the workflow
- 50:18of how we do things.
- 50:19It's very tricky because the incentives are sort of opposed to the right behavior somewhat,
- 50:25as you described about like, if there's a big problem, we're going to have to retract the
- 50:29paper.
- 50:31There are some things trying to solve that a little bit like Joss, Journal of Open Source
- 50:36Software.
- 50:36Are you familiar with that?
- 50:37Yeah.
- 50:37Yeah.
- 50:37So, I mean, you can publish the code there and get some eyes on it, but fundamentally, right,
- 50:44eventually you've got to take it and do the research.
- 50:46And if the problem is found afterwards, it's bad.
- 50:49But at the same time, I mean, isn't really the zen of science to get it right?
- 50:54Again, the pressure, the time constraint that we all have makes it that it doesn't happen.
- 50:58But another lesson from computer science, part of this was listening to Brian Okken and his
- 51:04podcast and then also trying to get through his book, which is really good.
- 51:08But again, it's that thing of it's good, but it doesn't really apply, or at least I couldn't jump
- 51:14into it and directly apply it because it's too big of a step for what I do because most of the code,
- 51:21some of it is reusable, but a lot of it is case specific.
- 51:25And so to build up a whole test suite around my code seems a bit overkill, but that's definitely
- 51:32a way to prevent the issues that if I could test my code, maybe simulate some data.
- 51:36That'd be very useful.
- 51:37And I think it's a great lesson, right?
- 51:39Take some pytest and write some tests or even in MATLAB or whatever.
- 51:43But I do think testing science is harder than testing a lot of things that people talk about
- 51:50testing when they talk about unit testing.
- 51:52For example, if I write a test for my online course site, right?
- 51:56I want to test that users can sign up, but they can't sign up if they pass a bad email
- 52:00address or something like that, right?
- 52:01Here's a good email address.
- 52:03It returns true.
- 52:04Email is valid.
- 52:05Here's a bad email address.
- 52:06It returns false.
- 52:07Email not valid.
- 52:08But if I have, here are some wiggles and gravity.
- 52:13Was that a black hole collision?
- 52:14Like, I don't know.
- 52:16We've never observed it before.
- 52:18I'm not even like, you know, like, you know what I'm getting at?
- 52:21It's just like, it's really hard.
- 52:23And so, I don't know.
- 52:24Do you have any advice?
- 52:25Like, maybe take data that you know the outcome of and then try to run your code and predict
- 52:30something that you know should be some way?
- 52:32Or I don't know.
- 52:33What do you advise people like?
- 52:34Because it seems much harder from a software side to write the right test for that kind
- 52:40of stuff.
- 52:41Yeah, I definitely think that's the test your code where it's possible in terms of just
- 52:45line to line or functions.
- 52:46But then when it actually is interfacing with the data, I think simulating the data or a
- 52:52data that's already been, you know, analyzed and processed.
- 52:55Those are the two things that I think have to be done a little bit more.
- 52:58And some fields just do it innately, whereas we don't.
- 53:01And sometimes there's a limitation to how much we can test the code in this case.
- 53:05But I think that being able to simulate data and having it know the outcome before you
- 53:10run it through it, it gives you at least some amount of certainty.
- 53:13So yeah, that's one thing that people could start doing a little bit more.
- 53:17But where do they start?
- 53:18I mean, for myself, that's one that I don't know how.
- 53:20There's Greg Wilson, the founder of Software Carpentry, has this series of papers on, in
- 53:26a sense, best computer practices, scientific computer practices, and good enough.
- 53:30And in there, it's true.
- 53:31We don't have enough time to be perfect.
- 53:33So good enough for most of us is good.
- 53:36And he mentions testing your code.
- 53:38But that's where it ends, is that, you know, he might put a reference.
- 53:41But I don't necessarily think that the current way to do it for, you know, big software programs
- 53:47or projects translate all that well.
- 53:49Obviously, some types of sciences, that's what it is, because it's all based around big programs
- 53:53and big pipelines of data analysis.
- 53:55But on the people that are more like myself, that do data collection themselves, they write
- 54:00their code themselves, they write the papers themselves.
- 54:02It's, I'm just not sure how to test my code.
- 54:05Or if I do, it's going to be clunky, it's going to take me a long time.
- 54:08And is it necessary to be at that level?
- 54:11I would love for somebody.
- 54:12But again, it's this thing, everybody's strapped for time.
- 54:15And so somebody like Brian, obviously has no interest in writing a textbook or a blog series
- 54:20on how can scientists test their code.
- 54:22And also, it's the fact that we're so different, that the fields are so varied.
- 54:26And so I still feel that while I think computer uptake in terms of programming, Python, those
- 54:31types of things has definitely skyrocketed.
- 54:33Some of the tools that come along with computer science haven't matured or morphed enough to
- 54:40make it easily implementable.
- 54:42So, you know, GitHub is something that version controls, obviously, another important thing
- 54:46to talk about in terms of computer software.
- 54:49And I think software carpentry teaches that on its two-day course.
- 54:53And it's just logical, I mean, in terms of the way.
- 54:55Yet scientists, I don't know, there's a comic strip called PhD, Piled Higher and Deeper.
- 55:02And there's this one that everybody puts up as a slide often.
- 55:06It's the, he has his thesis version as a doc, a Word document.
- 55:12And it has a thesis version one doc, and then it has version 1.2.
- 55:17And then it has final, and then final, final, and then final, final, underscore, dash, final
- 55:21changes.
- 55:21And I cringe because I actually looked back when I found that at my own thesis.
- 55:27And that's exactly what I had.
- 55:29You're like, look, this is an interesting naming convention.
- 55:32It's slightly different than mine.
- 55:33Exactly.
- 55:34Everybody kind of laughs at it when you show it.
- 55:38But really, there's no great workaround.
- 55:40Because, you know, like a Word, for example, does have this inbuilt thing that you can, you
- 55:46know, track changes, everybody loves it.
- 55:47But once you accept that change, it's gone.
- 55:49So if you want to have a history of it, you need to save a new version of it.
- 55:53And there's the more collaborative online things that, you know, Google Docs and stuff like
- 55:57that.
- 55:57But still, the idea of having a history, and in a sense, that's what science is about, is
- 56:02being able to show from the raw data, all the steps that were done.
- 56:06And I think it should continue on to the manuscript as well.
- 56:09So version control is another important lesson that we can apply, I think.
- 56:13I just noticed that Google Docs, I know they had a version history, but you can tag different
- 56:17versions, which is kind of cool.
- 56:19Like, so you could have final, final, final, final changes.
- 56:22Just in one doc, right?
- 56:27And I guess the last thing to highlight, I think that, again, I'm a bit of a geek, so
- 56:32I'd actually like to do this.
- 56:33But the people I've been surrounded generally aren't people who code and especially don't
- 56:38code in Python.
- 56:38But this idea of a code review.
- 56:40Yeah.
- 56:41I was baffled to hear that people actually do that.
- 56:43Like, people sit in a room and present code.
- 56:46And I was just like, that would be, as a person who doesn't know how to code or just learning,
- 56:50to just sit in on that would be useful.
- 56:52And then also to sit there and have other people who code kind of critique it, but also improve
- 56:57it or see if there's any issues and help answer some of my questions.
- 57:01I'm like, wow.
- 57:02And I'm sure it happens in some bigger labs.
- 57:03Yeah.
- 57:04But on the day-to-day, pretty much my second personality is the person I do my code review
- 57:09with.
- 57:09That's about all I have is I just sit there and I, does this make sense?
- 57:13Talk out loud, maybe.
- 57:13And it's another way that, although it seems currently that the publication, once it's out
- 57:19there, you don't want any problems to be found because you may have to retract it.
- 57:23So what can be done beforehand?
- 57:25Well, you know.
- 57:26Right.
- 57:26How much can you bring that up ahead of the release?
- 57:29Exactly.
- 57:30Yeah, yeah, yeah.
- 57:31Absolutely.
- 57:31Yeah.
- 57:31So that's one other thing that we could do.
- 57:33But the time constraints make it that it just, unfortunately, I haven't seen it implemented
- 57:37very much.
- 57:37Well, I think it's probably, it sounds to me like it's, in my experience, working in
- 57:41like a cognitive science research lab and some other stuff, I feel like maybe it's time,
- 57:47but even the bigger challenge is expertise, right?
- 57:51Usually, you know, who are you going to go to?
- 57:53Because you're the person that knows the most about that.
- 57:56So here we are.
- 57:57I'm going to do what I can, right?
- 57:58Yeah.
- 57:59I think it would be a really cool service to set up some kind of, not like GitHub, but
- 58:05some kind of online thing.
- 58:07Maybe you can link your GitHub profile to it or something where it allows scientists to donate
- 58:15a little bit of time in order to receive code reviews of their code, right?
- 58:19Like if I could put up my code into this project, you know, it'll still stay hidden, not going
- 58:24to come out.
- 58:24But if I agree to code review somebody's stuff collaboratively with them, then they'll do
- 58:29it for me or someone else will do that for mine, right?
- 58:32Like I earned a half hour of code review by doing a half hour for someone else.
- 58:36Or I don't know.
- 58:37It seems like there's probably some way to like put this out on the internet and create it in
- 58:41a way where, you know, the 20 people that are doing this kind of thing actually could
- 58:45get together and have a look and help each other out maybe.
- 58:48Yeah.
- 58:48No, I think that'd be useful.
- 58:49And, you know, you have to find the people that you would trust to do that.
- 58:53But it's similar to, you know, the earning beans for giving good feedback.
- 58:57I think here you can earn trust points or whatever it would be.
- 59:00And, you know, the quality of your comments and keeping it to yourself.
- 59:04But yeah.
- 59:04And proper coding practices, simply breaking it down into small, biteable chunks means that you
- 59:10can reuse it yourself.
- 59:11So once maybe you've got some feedback on a section or maybe somebody will tell you,
- 59:15turn that into a function.
- 59:16Well, then once it's been reviewed, you can kind of trust it.
- 59:19But I think a lot of us just get into it.
- 59:22We just want the answer.
- 59:22And we, in a sense, we probably reinvent the wheel way too many times.
- 59:25Yeah.
- 59:25That's something I definitely saw a lot of is like, here's a huge long script with no
- 59:30function or branching or other than an if statement.
- 59:33You know, it doesn't have, it doesn't have a lot of structure to it, which means it's nearly,
- 59:37it cannot be reused almost, right?
- 59:40Exactly.
- 59:40And one of the things you touched on is one of the big differences between scientific
- 59:45computation code and like computer science, formal software developer code is you hinted
- 59:52at it before, but it's like you often hear that code is read way more times than it's written.
- 59:58It should be written first for the software developers.
- 1:00:01And then secondly, so it also runs things like that, right?
- 1:00:04Whereas with science code, it's like, once you get it working and you get the graph, you're
- 1:00:09done.
- 1:00:09You don't need to polish it.
- 1:00:10You don't need to touch it again.
- 1:00:11It works.
- 1:00:13It did the thing.
- 1:00:14We got the outcome.
- 1:00:15We're going to come up with something different next time or whatever.
- 1:00:17Right.
- 1:00:18And I think that puts a very different kinds of pressure on organizing your code, reusing
- 1:00:23your code, documenting your code.
- 1:00:24There's just like all these different pressures.
- 1:00:26And I'm not saying one is better than the other necessarily.
- 1:00:29If your job is to like, I got to quickly analyze this data and get it out.
- 1:00:32Like, I'm not going to tell you all.
- 1:00:34And you have to make a package while you're at it, right?
- 1:00:36Like, that's not your problem.
- 1:00:37But it does mean the code is treated differently.
- 1:00:41It potentially has errors lurking in different ways and so on, right?
- 1:00:45Yeah.
- 1:00:45And I think that's the workflow hasn't been adapted very much to the lifecycle of the kind
- 1:00:52of code that we would write.
- 1:00:53And I think it's the lesson of take as much as you can and turn it into functions and things
- 1:00:58that you can reuse.
- 1:00:59And then, you know, build tests around those, for example, or have code reuse on those.
- 1:01:04And then the nuances for this current study, well, that'll be, you know, something to maybe
- 1:01:08just be a little bit more careful about and maybe have somebody look at it or check the
- 1:01:12outputs.
- 1:01:12But it's true that, you know, I was listening to it really rung a bell when Brian Okken said
- 1:01:17that about, you know, in terms of testing, why not?
- 1:01:20When once the test is built, once the code is written, you're going to make it legible,
- 1:01:24obviously make it clear, but also make sure that it's correct because it's, you're going
- 1:01:28to be looking at this over and over and over.
- 1:01:30And it's going to, you know, whereas in science, I write all the time.
- 1:01:34I read very little code.
- 1:01:36I barely know how to read other people's code.
- 1:01:38And that's interesting to me too, because I'm sure that with all your experience of the
- 1:01:43various languages that you know, you can kind of look at different code and kind of pick
- 1:01:48up quickly the general structure of things, even if the variable names are funny or versus
- 1:01:53for me, because I've got such a personal style that I've kind of adopted based on the
- 1:01:57various things, the resources I've used, you know, I can read my code very well.
- 1:02:01But then the second I go just slightly differently, I'm just bleary eyed.
- 1:02:06I'm like, what are they doing here?
- 1:02:07And I can't.
- 1:02:08And it's because we were very much just code for ourselves.
- 1:02:10Not everybody, but many scientists code for themselves or maybe one other person.
- 1:02:15Yeah.
- 1:02:16Yeah.
- 1:02:16And so it makes it a little bit more difficult.
- 1:02:19But that idea of code reviews, I agree that if you can't, somebody else doesn't know how
- 1:02:23to code, well, they're not going to be able to help you with the line to line things.
- 1:02:27And while I have a bit of a love hate relationship with Jupyter notebooks, the one thing that I've
- 1:02:33think that they're really useful for is you can sit in a room with your lab group, for example,
- 1:02:40and you can intertwine code with outputs, with figures, and you can tell the story of
- 1:02:47your code.
- 1:02:48And while the, you know, if there's a, you're calling the wrong function or there's a little
- 1:02:53bit of a mistake, those might be more difficult for others who don't code defined, but at least
- 1:02:57the structure of your code, what it's doing, what it's exceptions that it's trying to catch.
- 1:03:02You can do that.
- 1:03:03I mean, I think Python's very readable as a language, but I think that the Jupyter notebook
- 1:03:07makes it even more accessible because you can document it.
- 1:03:09You could put little interpretations here and there, and then the figures are output.
- 1:03:12It's kind of a way to do a bit of a code review for people who would probably run away from
- 1:03:17that and be a bit scared of saying, let's come to this code review at 12 today.
- 1:03:21Nobody's going to show up, but if you can, come on, I'm going to show you how I analyze
- 1:03:24my data and I'll show you some results.
- 1:03:26You can kind of secretly put in a bit of a code review.
- 1:03:29You can hide it in a Jupyter notebook.
- 1:03:31Yeah.
- 1:03:31Disguise it.
- 1:03:32Exactly.
- 1:03:32That's a good idea.
- 1:03:35Very, very cool.
- 1:03:35Well, you know, thinking through this, looking back on what you've been saying,
- 1:03:39it does sound like there's some interesting things to take from the computer science world
- 1:03:43and adopt into the scientific world.
- 1:03:45But I would say one really good thing that it seems to me is if what we're doing is moving
- 1:03:51people from Excel into something like Python, even if there's fewer tests than maybe ideally
- 1:03:57and whatnot.
- 1:03:58Surely the code can be more validated in Python or Jupyter than it could be as it is in Excel,
- 1:04:06right?
- 1:04:06So that's got to be good for reproducibility and correctness.
- 1:04:09Yeah.
- 1:04:09No, I totally agree.
- 1:04:10And simple lessons about, you know, variable naming and just how to structure the code into
- 1:04:16functions.
- 1:04:16The more functions you have, then the main script, if you like, just becomes very readable.
- 1:04:21If you give it in one of your courses, it's all about you highlighted, just make, I was
- 1:04:25surprised at how long your function names were.
- 1:04:27But on the other hand, they were so clear.
- 1:04:30I'm like, I know exactly what this thing does versus I had this weird, I don't know where
- 1:04:34I learned it, but you know, you had to abbreviate everything and keep everything as short as you
- 1:04:37can.
- 1:04:37Right, right, right.
- 1:04:37And then six months from now, I can't remember what it does.
- 1:04:40But when you take the time to just make a bit of a very clear descriptive function name,
- 1:04:45then the main script actually reads really well.
- 1:04:47And so those are little lessons that, you know, it'll help everybody interpret it a bit better.
- 1:04:52And if you make that public, it's so much easier for somebody else to look at that, possibly
- 1:04:56even reuse it.
- 1:04:57Whereas if you open up an Excel spreadsheet, I don't even know, how would you find out all
- 1:05:02the cells that have background computations or macros?
- 1:05:06I don't even know how you get started.
- 1:05:07I have no idea.
- 1:05:08You can't go through every Excel, it's in Excel, there you got it, it's crazy.
- 1:05:12Yeah, yeah.
- 1:05:13Well, I really appreciate that comment.
- 1:05:14I'm like, you're allergic to Excel, I'm allergic to comments.
- 1:05:18So anytime I'm about to write a little name function and then give it a comment to say what
- 1:05:23it should do, I'm like, oh, maybe its name should just be what it does.
- 1:05:26And then we won't need a comment, will we?
- 1:05:28Yeah, no, that was a good tip.
- 1:05:29So I use that all the time there.
- 1:05:31Awesome.
- 1:05:31I really do like this good enough practices in scientific computing that you referenced.
- 1:05:36And I'll be sure to put that in for the show notes.
- 1:05:39But it's got like really easy to adopt and reasonable stuff.
- 1:05:44So it's clear, concise steps.
- 1:05:46That's really great.
- 1:05:47All right, Martin, I think it's a good place to leave it for our main topic.
- 1:05:50But before you get out of here, let me ask you the last two questions.
- 1:05:53If you're going to write some Python code, do some research.
- 1:05:56What editor do you use?
- 1:05:57It's been PyCharm for a few years now.
- 1:05:59And just to anybody who out there is an academic or a researcher, you can get a free pro license
- 1:06:05if you just email them your academic email.
- 1:06:07And you can renew it every year.
- 1:06:09So it just gives you that extra bit of...
- 1:06:10So if it comes from a .edu or something like that?
- 1:06:13Exactly.
- 1:06:13And then you get the functionalities for the scientific mode.
- 1:06:16That's the main one I would use.
- 1:06:17Right.
- 1:06:18And you can actually access all the JetBrains programs, IDEs.
- 1:06:23But personally, I just use PyCharm.
- 1:06:24But yeah, so we can get a pro license as academics.
- 1:06:27Nice editor and nice tip.
- 1:06:29All right.
- 1:06:29A notable PyPI package that you've run across that people should know about?
- 1:06:32I would say one that I emulated because at the time it was a bit above my head.
- 1:06:37But there's something called PsychoPy.
- 1:06:39Yeah.
- 1:06:39Not in psychopath, but psychology.
- 1:06:41And it's this framework to test, to collect data in presenting different types of stimuli
- 1:06:47that you might do in psychology, like visual illusions or sounds.
- 1:06:50And it's a nice way they actually have now implemented it.
- 1:06:54So you can actually design and run your experiments right on the web.
- 1:06:56But you can also implement it on your own machines.
- 1:06:59So PsychoPy is a group in England that's been doing that.
- 1:07:02Just recently, there's a package called DABEST.
- 1:07:05I think it's DABEST.
- 1:07:07I don't know how to say it.
- 1:07:08D-A-B-E-S-T.
- 1:07:09Pi.
- 1:07:10DABEST.
- 1:07:11Yeah.
- 1:07:12It's data analysis through estimation.
- 1:07:14And it's pretty much there's this trend towards moving away
- 1:07:17through from just simple p-values and just saying that something is significant or not
- 1:07:22to providing appropriate estimates of these effect sizes.
- 1:07:24And sometimes your data is parametric, which means normally distributed.
- 1:07:28Other times it's not.
- 1:07:29And so there's this move towards estimating these things in the confidence intervals.
- 1:07:33But there's some of the statistical software doesn't do it for you.
- 1:07:36So these people, I'm pretty sure they're from Singapore.
- 1:07:39And it's cross-platform, but they have a version for Python.
- 1:07:42And it gives you these beautiful plots.
- 1:07:43It computes your estimates for you, but it gives you these wonderful graphs of the effects.
- 1:07:48And it's all done through bootstrapping.
- 1:07:50So it has no assumptions about the distribution of your data.
- 1:07:53So that's a really neat one.
- 1:07:54They came out, I think, just a few years, not even a year ago, I think.
- 1:07:56So that's quite useful.
- 1:07:57Yeah, those are great suggestions.
- 1:07:58Awesome.
- 1:07:59All right.
- 1:07:59Final call to action.
- 1:08:00People are out there.
- 1:08:01Maybe they're scientists or do scientific computing.
- 1:08:04They want to bring some more of these ideas from computer science to their world.
- 1:08:07I would say for yourself, smallest, biteable chunk.
- 1:08:12Implement something for yourself.
- 1:08:14And then also just try to, in the tea room, coffee room, just mention it to people.
- 1:08:18And if you hear about issues, don't sound like the smartass who says, why didn't you code that?
- 1:08:23Just say, hey, if you want to sit down for two seconds, I can just show you something.
- 1:08:27And because I think that there's this dualism of people who code and those who don't.
- 1:08:31And I think that the magic of it for some people is a bit intimidating.
- 1:08:35And so rather than keeping the magic for ourselves and being a bit elusive, I think just demystify
- 1:08:41the whole thing and just say, hey, look, it's really simple.
- 1:08:43Let's just do this.
- 1:08:44And I think the more people can do that and make it part of the culture of how we do things,
- 1:08:48I think that helps.
- 1:08:49And support from above.
- 1:08:51So the senior scientists who may not have come through a time when coding was available all
- 1:08:56that readily or was a specialty, even if they don't want to themselves, support the
- 1:09:00junior people and realize that, you know, for their future careers and just for the betterment
- 1:09:04of reproducible science, try to support it if you can.
- 1:09:07Very good advice and super interesting ideas.
- 1:09:10Thanks for sharing them with us.
- 1:09:11All right.
- 1:09:11No, thank you, Michael.
- 1:09:12You bet.
- 1:09:12Bye.
- 1:09:13See you.
- 1:09:21This has been another episode of Talk Python To Me.
- 1:09:23Our guest on this episode was Martin Haru, and it's been brought to you by Clubhouse and Linode.
- 1:09:29Clubhouse is a fast and enjoyable project management platform that breaks down silos and brings teams
- 1:09:34together to ship value, not features.
- 1:09:36Fall in love with project planning.
- 1:09:38Visit talkpython.fm/clubhouse.
- 1:09:42Start your next Python project on Linode's state-of-the-art cloud service.
- 1:09:45Just visit talkpython.fm/Linode, L-I-N-O-D-E.
- 1:09:50You'll automatically get a $20 credit when you create a new account.
- 1:09:53Want to level up your Python?
- 1:09:55If you're just getting started, try my Python Jumpstart by Building 10 Apps course.
- 1:10:00Or if you're looking for something more advanced, check out our new async course that digs into all the
- 1:10:06different types of async programming you can do in Python.
- 1:10:08And of course, if you're interested in more than one of these, be sure to check out our
- 1:10:12Everything Bundle.
- 1:10:13It's like a subscription that never expires.
- 1:10:15Be sure to subscribe to the show.
- 1:10:17Open your favorite podcatcher and search for Python.
- 1:10:19We should be right at the top.
- 1:10:20You can also find the iTunes feed at /itunes, the Google Play feed at /play,
- 1:10:25and the direct RSS feed at /rss on talkpython.fm.
- 1:10:29This is your host, Michael Kennedy.
- 1:10:32Thanks so much for listening.
- 1:10:33I really appreciate it.
- 1:10:34Now get out there and write some Python code.
- 1:10:36I'll see you next time.