Latest / Talk Python To Me / #200: Escaping Excel Hell with Python and Pandas
Transcript
- 0:00Do you know or maybe work with people who abuse Excel?
- 0:03Is it their hammer to pound all the computational problems that get in their way?
- 0:07Well, join me to chat about this opportunity to bring Python deeper into their lives.
- 0:12You'll meet Chris Moffitt, who runs Practical Business Python.
- 0:15He works with lots of folks who could make better use of Python to solve their business problems
- 0:19and has a ton of material on his website focusing on just that.
- 0:23It's time to escape Excel hell with Python and Pandas.
- 0:27This is Talk Python To Me, episode 200, recorded January 21st, 2019.
- 0:32Welcome to Talk Python To Me, a weekly podcast on Python, the language, the libraries, the ecosystem, 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
- 0:59and follow the show on Twitter via at Talk Python.
- 1:02This episode is brought to you by Linode and Stellar S.
- 1:05Please check out what they're offering during their segments.
- 1:07It really helps support the show.
- 1:08Chris, welcome to Talk Python.
- 1:11Hey, great to be here.
- 1:12Yeah, it's great to have you here.
- 1:13You've got some really interesting and amusing presentations around Excel.
- 1:17And not doing bad things with Excel, but maybe using it when they should use something else like Python or Pandas.
- 1:25Absolutely.
- 1:26Yeah, yeah.
- 1:27I mean, Excel in and of itself probably isn't bad or good, but it's like many things, the only tool that people have.
- 1:34And sometimes it can be used in ways that cause a lot of pain in the future.
- 1:38Yeah, it definitely can.
- 1:40You know, if you think of what is the most widely used and deployed databases within companies, like on install per install, it's probably Excel, right?
- 1:49Absolutely, absolutely.
- 1:50Absolutely.
- 1:50Absolutely.
- 1:50And I think it's funny.
- 1:52I've talked to other people in the Python community, maybe where they do more like Django development or really deep data science or testing.
- 2:01And I don't think a lot of people understand how pervasive Excel is and how it's used for everything.
- 2:07And the idea that you just replace Excel is really a non-starter at most organizations.
- 2:12Yeah, absolutely.
- 2:13It's pretty crazy.
- 2:14And it's going to be fun to talk about, you know, taking people on that journey, maybe saying like, look, you could dip your toe in this programming world.
- 2:22Like, you don't have to want to be a developer, but do you know how much better your life would be if you could learn like an if statement and a while loop and a few function calls?
- 2:30Like, it would be a lot better, right?
- 2:31Absolutely, absolutely.
- 2:32And especially some of the things that power users do in Excel, it is programming.
- 2:37I mean, they don't maybe think about it that way, but it is.
- 2:40And I kind of talk about if you can write a nested if statement in Excel, you can probably program Python.
- 2:47Yeah, because if statements in Excel are painful.
- 2:50Before we get to that, yeah, before we get to that, because it all fits on one line with no organization or structure.
- 2:55Exactly.
- 2:56I've read some myself.
- 2:57So before we get to that, though, let's just start with your story.
- 3:00How did you get into programming and Python?
- 3:01Sure.
- 3:02So I grew up in the early 90s.
- 3:05So my Apple IIc was first computer and studied, learned basic and actually learned Pascal in high school.
- 3:12And then in college, I studied computer science and electrical engineering.
- 3:16So I, you know, learned C, C++, kind of the traditional computer science curriculum at the time.
- 3:23Really enjoyed it.
- 3:24But when I graduated, I took a job where I didn't actually use any of it.
- 3:29So some of those skills kind of atrophied a little bit.
- 3:33And fortunately, throughout my career, as I've moved to other roles, I've been in typically a little bit more business type roles.
- 3:39But I've been able to use my technical skills to try and solve problems.
- 3:43So that's been kind of my evolution over the past many years that I've been doing this.
- 3:49Interesting.
- 3:49So what is your impressions and experiences of being this little more on the business side of things, but having that technical skill and looking at other people, trying to solve problems manually, copy paste, like no version.
- 4:03I'm just like looking at them going, do you know how much easier this could be?
- 4:07Like, what are you doing?
- 4:08Right.
- 4:09Is that sort of something that you encounter often?
- 4:11Absolutely.
- 4:12Yeah.
- 4:12That's definitely one of the biggest challenges is you mentioned something like version control.
- 4:17One of those things that is just once you start using it and get used to it, not having it is just extremely painful.
- 4:24But most people who don't program really don't use version control.
- 4:28They haven't used GitHub or Bitbucket or even SVN back in the day.
- 4:32When you see how manual things are, how people try and rename files as the poor man's versions control, it is painful.
- 4:42It is very painful.
- 4:43And I've had to think a lot about how do you approach that problem and not just tell people, oh, there's a better way to do it and just scrap everything you're doing and move to my way.
- 4:54Right.
- 4:54How do you help them make a few steps?
- 4:56So if renaming the files, having like Excel report May version 3 is like version 3 Kennedy or something like this, right?
- 5:05Exactly.
- 5:06Like a weird naming scheme.
- 5:07If that is the version control, then Outlook probably is GitHub, right?
- 5:12Like so you attach it to an email and it's like it's kept live in like this thread of email with the different versions in there, right?
- 5:19Absolutely.
- 5:20It's either Outlook or it's in the file share buried somewhere in multiple, you know, nested file subfolders that are impossible for anyone to actually find or understand.
- 5:31Absolutely.
- 5:31Yeah.
- 5:32And, you know, I think a lot of people either work independently or they work at like small companies.
- 5:36But the larger the company, the more this like the more people copied on those email threads.
- 5:41There's like 20 people and they all have their little tweaks in versions.
- 5:44And it's crazy, right?
- 5:46It is.
- 5:46And it's so frustrating because you want to just say, hey, can't we just put the data set in one place and we're all working off of it and using version control just like you would in an open source project that the concept just isn't there.
- 6:02And I mean, there are some tools, some of the more recent Microsoft tools support it a little bit, but it's still not, at least in my experience, doesn't seem to be as common as you would expect.
- 6:12Yeah.
- 6:12A lot of times what the answer seems to be at these big organizations is like, well, this Outlook named thing as version control sucks.
- 6:20So let's use SharePoint, which is like its own special type of hell.
- 6:25Yes.
- 6:25You know, I haven't used SharePoint a lot, mainly because I've heard, you know, it's its own special type of hell.
- 6:31And I think now Microsoft Teams is the new thing, but I haven't used that enough to really figure it out because it is.
- 6:38It's a lot of time and energy figuring out how to use it and then to get the people you're working with to use it as well.
- 6:45Yeah.
- 6:45Let me see if I can summarize my SharePoint experience.
- 6:47Like, oh yeah, that's on the shared SharePoint project site.
- 6:50Okay.
- 6:50Where is that?
- 6:51And eventually someone will send me a link and then I'll click on it and it'll say access denied.
- 6:57And I'll say, oh, you never gave me access to that part of the project.
- 7:00Oh, and they'll come back and then they'll give me access to it.
- 7:03And then you can like check out the file, which downloads it and locks other people from checking it out.
- 7:08But, you know, maybe someone's already checked it out and forgotten it.
- 7:11So you can't get it.
- 7:12It's just like, what are we doing?
- 7:14Like, this is crazy, man.
- 7:15Yeah.
- 7:16So it's really frustrating those things.
- 7:18Yeah.
- 7:18Yeah.
- 7:18I've had similar experiences as a user just trying to get it to work and it just didn't seem like it was worth the effort at the time.
- 7:26Yeah, for sure.
- 7:27So you've started Practical Business Python, this project to sort of help take people along, right?
- 7:34Tell us a little bit about that.
- 7:35Sure.
- 7:35So I've always kind of, you know, had a little bit of that technical itch that I wanted to scratch.
- 7:42And I did some Django development back in the day.
- 7:47And after a while, for multiple reasons, I wasn't doing that as much.
- 7:50And so I felt like, you know, I just didn't have that much going on.
- 7:55And probably, I think in 2014, I decided, you know, I'd like to do something else to get that technical information out there, to keep my skills up, to share with others.
- 8:05But I didn't want to embark on a huge open source project, something that I was going to have to maintain.
- 8:10So I thought, you know what?
- 8:11I'll do a blog, get this started.
- 8:13And it's funny.
- 8:14Originally, I thought I was going to spend more time talking about, like, Raspberry Pi, Internet of Things type work.
- 8:21But as I started getting into it, that's when the whole data science thing, or I guess probably when I started learning more about data science, and then learned about Pandas and those tools and started applying them to the problems I had.
- 8:33And it was just like, wow, this is really cool.
- 8:35I got to learn a lot, got a lot of really positive feedback from folks.
- 8:38So it was really exciting.
- 8:40Yeah, that's awesome.
- 8:41And Pandas is nice because it solves a lot of those problems automatically, right?
- 8:44It'll read a CSV directly, and it'll kind of let you sort and things like that.
- 8:50It has a lot of the features at the code level that other people might need at the, you know, Excel or GUI level, right?
- 8:58Absolutely, absolutely.
- 9:00And I think one of the things that really sold me on Pandas, I had done in my role, I identified one process that was just extremely manual, a lot of work that it would take to build this report essentially on a monthly basis.
- 9:15And going back to, you know, when you only know one tool, everything looks or when you only know how to use a hammer, everything looks like a nail.
- 9:22So I decided I was going to build my data processing thing using Django.
- 9:26So Django admin and Django ORM, and I put it together.
- 9:31And it worked.
- 9:33I mean, but it was slow.
- 9:34So I would do this, I would kick this process off, and it would take maybe an hour to run.
- 9:39But it was an hour I could go to lunch, get coffee, whatever.
- 9:41So it was no big deal, and it worked well.
- 9:44Eventually, once I learned Pandas and got over that learning curve, and then I solved the same exact problem in Pandas on the same exact hardware, and it took like two minutes to run.
- 9:55That's incredible.
- 9:56So it's, you know, just Pandas because it uses NumPy and all the lower level functions written in C.
- 10:02And if you do things right, it's pretty quick.
- 10:05And so once I kind of had that experience, I'm like, okay, there's no reason we can't use some of these tools to solve some of the problems we have right now.
- 10:13Yeah, that makes a lot of sense.
- 10:14And, you know, Pandas, its origins, a lot of people think of it around data science.
- 10:17So maybe they think machine learning, they think science, but it really comes from the financial industry.
- 10:22And it's probably got its roots right from Excel, more or less, right?
- 10:28Like right near there.
- 10:29Exactly.
- 10:30And if you start, you know, kind of looking around at Pandas, there's a lot of things around time series and grouping of data that are just really, like you said, really kind of from the finance world and are very applicable to a lot of the kind of common problems that people use Excel for in many large organizations.
- 10:47Yeah.
- 10:48So I was looking over your blog and all the articles you've written.
- 10:51There's a ton of resources there.
- 10:53It looks like you've been at this for quite a while.
- 10:55And you said you use the Feynman learning technique, as in Richard Feynman, the physicist, right?
- 11:01Yes.
- 11:02What's the story there?
- 11:02Yeah.
- 11:02Well, I certainly didn't start off doing this, but this is something I don't remember when I first learned about it.
- 11:08But basically, the idea is you take some sort of concept, you learn it, and then figure out how to teach it to someone that really doesn't know anything.
- 11:16Now, Feynman talks about teaching it to a toddler.
- 11:19Certainly, my articles aren't at the toddler level.
- 11:22But by going through and actually writing a blog post and understanding it at the level of detail that you need to to write a post and put it out there on the internet, it really does force you to kind of have this feedback loop that he talks about where you think you understand something.
- 11:37But once you try and put it in a blog post, you realize, ooh, I didn't understand it as well as I thought I did.
- 11:43And so then you kind of loop back.
- 11:44And by the time you're done actually writing a good post, what I find is, you know, I really understand the concept pretty well.
- 11:50And that's what I try and do with the blog post is get it out there so that others can learn.
- 11:54Yeah, it's interesting.
- 11:55You see these polished blog posts or conference presentations or even online courses, and you're like, that person so deeply knows this stuff that they're teaching me this, that it's great I got this article or this video or whatever, but how am I ever going to reach that level?
- 12:13And the reality is probably that person who did that presentation went on that journey as part of creating this thing, right?
- 12:20Like they may have not known very much at the beginning, but they kind of applied this technique knowingly or unknowingly to just go like, I am interested.
- 12:29I know a little.
- 12:30I'm going to just dig in and like really put it together.
- 12:32Absolutely.
- 12:33And I think the funny thing is I was actually working on a post this morning where I'd written it a couple of years ago and the API, Pandas API has changed, so I need to update it.
- 12:43And I like had to really go back and figure out what I had done.
- 12:46And I know people have talked about this before about there's got to be some name for when you have a problem and you Google it and it's a blog post that you wrote and forgot about.
- 12:55I mean, it happens to me all the time.
- 12:57I was just thinking of that.
- 12:58Like I've had that problem happen to me as well.
- 13:01Where I'm like, gosh, I really don't remember how this works.
- 13:04I know I did something with it a while ago and I Google it and the best answer is something that I've done.
- 13:09I'm like, oh, I'm all hope is lost.
- 13:11Yes, exactly.
- 13:13If this is at the top and I don't remember it, we're kind of done here.
- 13:16Yeah.
- 13:17No, but it's a really good point.
- 13:18I mean, I think this is a it's very easy for new users to get discouraged because it is a lot to learn.
- 13:25And I think it's really important.
- 13:27You do a great job on your show with the other guests and letting people know that we're all human.
- 13:32We're all trying to learn.
- 13:33And some of this stuff seems to slip out of your brain over time and you have to continually relearn it.
- 13:40Right.
- 13:40Well, at the same time, like so much stuff is changing that you have to eject some stuff to make room for it.
- 13:47Right.
- 13:47And it's a matter of can I go back and Google that thing or do I really need to force myself to remember it?
- 13:53Right.
- 13:53Like a lot of times it's like I have it written down or I have an example.
- 13:57Let's kind of just sort of forget that and really focus on this new library.
- 14:01Right.
- 14:01Like I want to learn Altair for graphing and I'm just going to forget the Matlab plot live API for a while because, you know, this is what I want to focus on.
- 14:08Right.
- 14:08There's just so much new knowledge.
- 14:10It's like this constant battle for cognition, basically.
- 14:13Right.
- 14:13Right.
- 14:13Absolutely.
- 14:14And I think at the end of the day, that's a lot of what I'm trying to do at the blog is not so much teach people to understand everything,
- 14:21but it's almost teaching them what is possible.
- 14:23So it's showing the tools that are out there and saying, here are the types of problems.
- 14:28And here is a way to sort of present the problem, maybe in a way that will apply to what you're working on today.
- 14:35Sure.
- 14:35And so what are some of the more popular topics or things that have come across on the blog that people liked?
- 14:41It's interesting.
- 14:42So one of the things I've learned in writing the blog is it is very hard to gauge what is going to be popular when you publish it and what's going to live on through the magic of Google search engines.
- 14:53And so some of the articles seem really popular in the beginning, but then hardly ever pop up in searches and don't get much traffic.
- 15:02And then others that seem to maybe be a little less exciting are the ones that tend to pop up on Google.
- 15:10So one of the most popular articles for a while was my pandas pivot table.
- 15:16I really enjoyed that one.
- 15:17I think that one was a good example where I felt like it was going to be popular.
- 15:21People enjoyed it.
- 15:23It was, I included, I think, a good summary of how to use the pandas pivot table.
- 15:26And that was really popular.
- 15:28The one that surprised me is the pandas data type article.
- 15:33So I explained how to use the different pandas data types.
- 15:36And that is one of my most popular Google search items right now.
- 15:40So, you know, I just can't quite figure it out.
- 15:44You know, sometimes I think about it and then other times I'm just like, well, you know, I'm going to write what I think people want.
- 15:49And sometimes they're hit and sometimes they're not.
- 15:51Yeah, it's a really tricky thing to try to guess that, right?
- 15:54You just kind of got to throw it out there and let the world decide what they're interested in.
- 15:58Because I've done that with blogging where I'm thought, I'll just throw this out, like whatever, I got to spare 20 minutes.
- 16:04And other times I'll spend a whole day writing something really polished.
- 16:08And I'm like, this is going to be the good one.
- 16:10And, you know, it's like kind of like, meh, people don't care.
- 16:12The one I threw together is like super popular.
- 16:14I'm like, if I knew it was going to be popular, I would put more effort into it.
- 16:17Same thing with videos on YouTube.
- 16:20Same thing with even the Talk Python episodes, right?
- 16:24Some are like, oh, this could be super popular.
- 16:26I'm not sure people are going to love that one.
- 16:27And it, you know, it's all over the map.
- 16:29Yeah, absolutely.
- 16:30And I think I've talked about this on some of your prior podcasts.
- 16:33Like as technical people, we're not necessarily good marketers.
- 16:37You know, we kind of expect all this content to stand on its own.
- 16:41The world's a meritocracy.
- 16:42If I make it well, it's just going to be fine.
- 16:43And like, that's just, it would be cool if that were true.
- 16:46It's not.
- 16:46It's not.
- 16:47It's not.
- 16:47And so that's one of the things, you know, I don't do a whole lot of promoting old articles.
- 16:51And I do wonder if, you know, should I do that?
- 16:54Should I kind of remind people, hey, here's something I wrote two years ago that's still,
- 16:57applicable.
- 16:58It's not something I do, but I think it should be done to really kind of keep this stuff fresh
- 17:04and remind people what's out there.
- 17:05Right.
- 17:05It's not a bad idea.
- 17:07I mean, one of the ways to promote anything like a blog or courses or videos or whatever
- 17:12is to just keep making new stuff that's exciting.
- 17:15And some of it will like not be as exciting as you thought it would.
- 17:18Some of it will be more and it'll draw people in.
- 17:20And then they'll find like, just keeping your profile high will help your older stuff stay
- 17:26relevant.
- 17:26Right.
- 17:27But there's also ways you could continue to promote them.
- 17:29Right.
- 17:29Like more explicitly for sure.
- 17:31Sure.
- 17:32And it is funny.
- 17:33I mean, you kind of, I kind of forget, like once I've got an article out there and there's
- 17:37kind of that initial bump for the first couple of weeks while people are discovering it.
- 17:41And then I almost forget about it.
- 17:43But it is amazing when someone will stumble upon an article that's three or four years
- 17:49old and it solves the exact problem and they leave a comment or send me an email or reach
- 17:53out and say, hey, Chris, that was awesome.
- 17:55Thanks.
- 17:55You saved me dozens of hours of time.
- 17:57And so, you know, it feels good.
- 17:59And it's good to remember that that's going on as well.
- 18:02Yeah.
- 18:02The long tail is definitely up.
- 18:04Exactly.
- 18:04Yeah.
- 18:05So let's dig into a little bit of this Excel hell story, right?
- 18:10Like you did a great presentation and we'll link to the slides, the PDF of the slides in
- 18:15the show notes that you talk about, like basically what is Excel hell and what is Python and Pandas?
- 18:20And it's a pretty good synopsis for folks who are presenting to a business audience.
- 18:25Sure.
- 18:25Excel hell in my mind is when you have a problem, it's a legitimate problem.
- 18:31You're trying to solve at work in your business setting and you've solved it using Excel and
- 18:39then you go back and try and figure out what you did.
- 18:42And it's impossible to recreate what you've done or impossible to just like tweak it slightly
- 18:49to use it for a new problem.
- 18:51It's just the kind of like pain you feel once you open up something you worked on six months
- 18:57ago in Excel and try and recreate it and understand what in the world did I do?
- 19:01Where were my data sources?
- 19:04What's the most recent version?
- 19:05You know, what have I changed?
- 19:07I mean, that in my mind is what Excel hell is.
- 19:10Yeah.
- 19:10Does it involve maybe like when you open up the worksheet that the app kind of goes like
- 19:16gray or white?
- 19:16Cause it's like not responding for a while cause something's happening in there.
- 19:20Yeah.
- 19:20I mean, there's certainly one where you're like, I think that's the challenge with Excel
- 19:25is there are so many different ways you can interact with the data.
- 19:29So you can have formulas, you can have VBA behind the scenes, you can have multiple tabs,
- 19:36you can have linked workbooks.
- 19:38And so when you open one, there's really no way to figure out what is going on.
- 19:42How did the data get there?
- 19:43What manipulations have been made?
- 19:45How is this supposed to be used?
- 19:47It's just it.
- 19:49People underestimate how challenging it is to decipher the, you know, the complexities of
- 19:54a big Excel workbook.
- 19:56Yeah.
- 19:56And the reason you get there is because these problems land in this like weird middle ground,
- 20:02right?
- 20:02Like they're not big enough to bring in like the software team to build a custom solution.
- 20:07There's probably not a SAS solution that's like immediately obvious out there, but it's,
- 20:13it's beyond just data, right?
- 20:15It's like, it has to make some decisions.
- 20:17And as soon as the conditionals start to appear in there, it starts to seem like, well, you're
- 20:23taking that first step down that slope is like, now here's where the if statements are in the
- 20:28table.
- 20:28And you're like, okay, here we go.
- 20:30Exactly.
- 20:30Exactly.
- 20:31And then there are so many cases of like when you're doing it and you like have a VLOOKUP
- 20:38formula and you forget to copy it down or, you know, you have the ranges wrong.
- 20:42I mean, there are just so many types of formulas, so many types of interactions that seem seductively
- 20:48easy, but just set you up where it's so easy to make a mistake and so hard to troubleshoot
- 20:54it when you do.
- 20:54Yeah.
- 20:55I mean, if you miscopied a formula, right?
- 20:57Like it's, how do you look at that thing and go, yeah, okay.
- 21:00Especially if it's spanning multiple sheets, like it can be a beast.
- 21:03Exactly.
- 21:03Exactly.
- 21:04And then, you know, like we were talking about earlier, the whole version control mess.
- 21:08I mean, there, there is no way to just do or no easy way to do a diff of the code and the
- 21:14spreadsheets to understand what's changed and why did it change and very painful.
- 21:19Right.
- 21:19Certainly direct version control won't help you.
- 21:21Right.
- 21:22Cause it's like, it's, I think it's an XML file that is the source file of Excel, but it's
- 21:26like zipped.
- 21:27So you can't actually diff the code or you can't, it's like if they just left it unzipped effectively,
- 21:32like at least you could diff it.
- 21:34Right.
- 21:34Right.
- 21:34But no, yeah.
- 21:35All hope is lost.
- 21:38This portion of talk Python to me is brought to you by Linode.
- 21:41Are you looking for hosting that's fast, simple, and incredibly affordable?
- 21:45Well, look past that bookstore and check out Linode at talkpython.fm/Linode.
- 21:50That's L I N O D E.
- 21:52Plans start at just $5 a month for a dedicated server with a gig of RAM.
- 21:57They have 10 data centers across the globe.
- 21:59So no matter where you are or where your users are, there's a data center for you.
- 22:03Whether you want to run a Python web app, host a private Git server, or just a file server,
- 22:07you'll get native SSDs on all the machines, a newly upgraded 200 gigabit network, 24 seven
- 22:13friendly support, even on holidays, and a seven day money back guarantee.
- 22:17Need a little help with your infrastructure.
- 22:19They even offer professional services to help you with architecture, migrations, and more.
- 22:23Do you want a dedicated server for free for the next four months?
- 22:27Just visit talkpython.fm/Linode.
- 22:29And then, you know, and we talked about like coming from a programming background.
- 22:36I mean, even if you just had a little bit of experience, the idea of an if statement, an
- 22:42if then else, or a case statement, or switch statement, you know, or defining functions, all
- 22:47is fairly straightforward.
- 22:49But when you try and cram all of that into a single Excel cell, you know, trying to, like
- 22:55we said, trying to do a nested if statement is just impossible.
- 22:58I mean, it is very, very hard to do and understand it.
- 23:02And I think anyone that's worked with Excel has opened up these spreadsheets and you click
- 23:06on the tab or on a cell.
- 23:08And there's just this massive formula with all these parentheses and all this kind of error
- 23:15catching.
- 23:15And you're like, how, how can I understand if this is even right?
- 23:19How can I troubleshoot it?
- 23:21It's yeah.
- 23:22So that's Excel hell in my mind.
- 23:24Sounds about right.
- 23:27I think for the purpose of this discussion, it sounds like it's more or less the same situation
- 23:33if like you're actually using Google Sheets or some other technically another tool than Excel,
- 23:37but something Excel like, right?
- 23:39Yes, absolutely.
- 23:40I mean, I think there are some things that Google Sheets makes a little bit better.
- 23:44I think, and I'm not a huge Google Sheets user, but it does kind of the versioning automatically
- 23:50and seeing the history, I think is a little bit better.
- 23:53And one of the things I think Google Sheets does better is it's easier to share.
- 23:57So if two people are working in it at one time, that works better than Excel, where it just
- 24:03locks the file and you have to yell at your coworker to get out, that kind of thing.
- 24:06Yeah, yeah, exactly.
- 24:07It is a little better there for sure, but it's also simpler.
- 24:11So maybe you can't push it as far, right?
- 24:13You can't get as far down that hole before you have to like scream for mercy.
- 24:17Right, right.
- 24:18Yeah.
- 24:18I haven't dived into Google Sheets to see like how complex can you do the formulas?
- 24:23I know it doesn't have VBA, but I'm sure you can program it behind the scenes.
- 24:27I'm sure someone's done something pretty crazy, but I think just Excel is just so pervasive
- 24:35and so misused in organizations.
- 24:37Yeah, yeah, yeah.
- 24:38Well, thankfully, both Excel and Google Sheets have Python packages that'll let you work on
- 24:44them, which we'll get to.
- 24:45Yes, exactly.
- 24:45Exactly.
- 24:46Yeah.
- 24:47Let's start with the question of like, why is Python better than Excel, right?
- 24:51Especially from the perspective of somebody who's like a power user, but they don't consider
- 24:56themselves a programmer.
- 24:58Like they wouldn't pick up code and think that that's okay for them.
- 25:00Like that's for someone else, you know?
- 25:02Right, right.
- 25:03There's a couple of things.
- 25:04One of them is Python.
- 25:06And when you use these tools are going to encourage a little bit better practice.
- 25:11So it's more reproducible.
- 25:13So you can look at a Python script and even if it's the newest of newbies and it's maybe
- 25:20not the most Pythonic, you can at least step through it and understand what's going on.
- 25:25And if you've maybe put some comments in there or used a Jupyter notebook to capture some of
- 25:31this information, there is like some reproducibility built into that.
- 25:36And you can step through it and see what's happening.
- 25:39And you can see, oh, I'm taking data A and data B and data C and I'm joining them together
- 25:45and I'm cleaning them and I'm doing all these types of things that a program, it's going
- 25:49to be fairly straightforward how this is happening in what order.
- 25:53Whereas Excel just by its very nature doesn't do that.
- 25:57It's super hard to even look in an Excel workbook and go, these are the parts where code is.
- 26:02Like you can't even see the code.
- 26:04You got to go touch every little cell to see, is this a formula?
- 26:07Is this a value?
- 26:08What other, it's like not linear, it's circular, it's cross sheet.
- 26:12It's, it's a little bit like VB with go-to.
- 26:15Yes.
- 26:15You know?
- 26:16Yeah, yeah, yeah, yeah, exactly.
- 26:18It's a lot of go-to statements.
- 26:20That's, that's a very good way to put it.
- 26:23Like a, like a two-dimensional go-to.
- 26:25Yeah, yeah, yeah, absolutely.
- 26:27One of the other problems with Excel is I do think it lends itself to some bad practices.
- 26:33So it is very easy in Excel to edit the data, right?
- 26:36If you pull in some data and a cell has the wrong value, you can just go in there and type it and fix it.
- 26:42Well, the problem is next time you pull the data, you don't know that you just fixed it.
- 26:47It's all live.
- 26:48So by having a program, you at least have to be more conscious in Python about changing a value.
- 26:56You certainly can, but you have to make a very explicit choice to do that.
- 27:00Right.
- 27:00If you somehow pulled a data source and dropped it in there, but then you tweaked it or you, yeah, then that's right.
- 27:06You're like, you never know.
- 27:07There's no history or artifact that says that this happened.
- 27:09Exactly, exactly.
- 27:10And then I think, you know, outside of the just overall benefits of having a program that's a text file that you can version control and understand,
- 27:19I think that the biggest benefit is you have access to all of the Python ecosystem.
- 27:25So all of the libraries, everything that's out there, whether it's data science or a web scraping or, you know, any of the thousands of things you can do with Python, you actually have access to it.
- 27:37Whereas even Excel, as you start to get into VBA, you can certainly do more.
- 27:44But if you wanted to go parse an XML file or scrape a web page, you can probably do it.
- 27:51But there's going to be a lot better ways to do it in Python.
- 27:54Yeah, sure.
- 27:55To try to calm object in C++ and distribute that, you'll be fine.
- 27:59Yeah, exactly.
- 28:00Exactly.
- 28:01Yeah.
- 28:02That just sounds horrible.
- 28:03I don't want to go anywhere near that.
- 28:04Yeah.
- 28:05Yeah.
- 28:05And obviously that's out of reach of the people who actually want to do those things, right?
- 28:08Right.
- 28:08So I think you're right.
- 28:10Like the ability to acquire and keep the data up to date, right?
- 28:14Like I'm going to use Beautiful Soup and Request to go grab this table off our internal intranet every day.
- 28:21So when I make the report, it automatically starts with absolutely fresh data and things like that, right?
- 28:27Right.
- 28:27Absolutely.
- 28:27And then my experience has been no matter how clean the data is, someone wants the report a little bit different or you need to apply some sort of business logic to clean it up.
- 28:38And if you have been doing that by hand and then you forget to do it, everybody gets upset.
- 28:44So then you can put it in Python, you can code it there and say, this translation always needs to happen and it's there.
- 28:50And then people don't get upset when it's missing.
- 28:53So there's just so many benefits to like having that repeatable record of what you've done with the data analysis.
- 29:02Yeah.
- 29:02We'll touch more on this later, but just having the ability to press a button and have the answer without going, what are the seven manual steps I got to do?
- 29:12And I hope I don't forget them.
- 29:13And, oh, I'm on vacation next week.
- 29:16And Sarah, who's never done this, it's her job to do those seven steps and just even have access to like, oh, my goodness.
- 29:22Right.
- 29:22Like, so just having this repeatable alone is pretty valuable.
- 29:26Absolutely.
- 29:27Absolutely.
- 29:27And then the other thing I'd say is I think it is interesting that Excel, as powerful as it is, it's pretty easy to get a data set that just doesn't work in Excel.
- 29:37So if you get a couple hundred thousand rows in Excel starting to try and manipulate it, it starts to slow down.
- 29:44It'll bog down your system.
- 29:45Whereas if you read that data into Pandas and do the manipulations, it's pretty fast.
- 29:51As long as you can fit it in memory, you can manipulate a lot of data in Pandas that would be difficult to manipulate in Excel.
- 29:58Yeah, that's a good point.
- 29:59And there's limits, actual limits to how much data Excel will accept, like a million rows or something, right?
- 30:04Yes, absolutely.
- 30:06And, you know, it does keep going up and you can have more rows and more columns, but it doesn't mean you can actually work with it when it's in there.
- 30:13Yeah, that's a different story also.
- 30:16But, yeah, cool.
- 30:18And then also, it's like you say, it's a proper language, right?
- 30:21If you learn to work with Excel, you can make really complicated Excel sheets.
- 30:26You learn to work with Python, all of a sudden, you start to see these other problems like, oh, I always copy these files from here to there and I always make these little edits to them.
- 30:34Or I always, you know, have to grab this data and transform it that way.
- 30:37And, like, it's sort of a good way to draw them into this automate your world space, right?
- 30:45Absolutely, absolutely.
- 30:46And then that's the thing that is nice about it is the internet loves to have language wars and we could fight about whether the Python is really the best language for the task.
- 30:56But in most places, it's going to be a pretty good choice.
- 30:59It may not be the best.
- 31:00So, if you have learned Python and then you expand and start doing something a little bit more than just the Excel manipulations you're doing, you're not going to have to relearn a bunch of things.
- 31:09You're not going to be going down a path where you've got to make a huge course correction at some point in your career if you decide to continue developing that skill.
- 31:18The hard part about learning programming is not learning the Python syntax, right?
- 31:23Like, that's not so hard.
- 31:24It's like, what is a loop?
- 31:25When do I use loops?
- 31:27What is a conditional?
- 31:27What is a data type?
- 31:29What data types are?
- 31:30Like, that's basically the same across all the languages, right?
- 31:33Exactly.
- 31:33It's just like, I need curly braces and parentheses and why are there semicolons everywhere, right?
- 31:37But still, like, it's no big deal, right?
- 31:39Yeah.
- 31:39Yeah, absolutely.
- 31:40Absolutely.
- 31:40Yeah, interesting.
- 31:41So, one of the things that I keep repeating is we don't need 100 million software developers, but we do need people who can do whatever they do better, right?
- 31:51And I feel like software development, a little bit of it, like the kind you're talking about, can really amplify whatever you're good at anyway, right?
- 32:00So, from this context, you know, maybe who people are listening, they're probably developers, but they probably work at companies where they get asked to help with Excel sheets or they have these automation problems that, like, start from Excel.
- 32:13Who should they go start going, I know I could write this for you, but let me help you learn to automate your world a little bit.
- 32:20Like, what type of folks should be reaching out to?
- 32:23So, I feel like there is, anytime you have a group of people that use Excel, and I don't know what the number is, but five to ten people, it seems like there's always someone that's like the Excel super user.
- 32:34So, it may be...
- 32:36Probably there's color, a lot of color in there, some formulas, right?
- 32:39Exactly, exactly.
- 32:40Now, definition of super user is going to vary.
- 32:42I mean, sometimes it could be someone that is really good at some pretty complex VBA.
- 32:47It could just be the person that understands how to put a pivot table together.
- 32:51But I think in any group where you have people that are doing repeatable type processes, there is someone that is the de facto expert.
- 33:01And that is the person that I would target and kind of say, okay, let's take a look at what you're doing here and see if there's an alternative to use this tool called Python to improve this process.
- 33:15You raise a really good point.
- 33:17And I think one of the big challenges here is these people aren't going to say, I want to learn programming.
- 33:25To them, it's like, I can't learn programming.
- 33:27I need to go to a university and get a four-year degree.
- 33:31And I would encourage the people that are listening, if they do have that Python knowledge, to kind of help ease them into that and say, you know what, you don't have to be a computer scientist to do this.
- 33:42Let me show you some of the simple things that you can do in Python to help with this process and get them started.
- 33:49And so, yeah, focusing on those kind of natural experts in the group.
- 33:53Yeah, that makes a lot of sense.
- 33:54And the fact that Python is not a compiled to machine instructions with a compiler and linker type of language means you don't have to drag them through the sort of software, computer science-y tool chain.
- 34:07You can just say you write this in a text file, preferably in a proper editor that helps you with spaces.
- 34:13Exactly.
- 34:13And autocomplete.
- 34:14And then you're kind of good, right?
- 34:15Yeah.
- 34:16You raise a good point.
- 34:17I think these, if you are a Python expert, you should be able to help get Python set up on their system.
- 34:24And I know you've talked about this before.
- 34:26It is much easier than it used to be back in the past, but it's still a non-trivial activity for someone that's not comfortable with this.
- 34:35I mean, I've had experiences where I've deployed some Python scripts and told people, okay, open a command prompt on your Windows system and type Python file name.
- 34:44And they, you know, it just kind of blows their mind a little bit.
- 34:47They're just not used to that.
- 34:49Most people don't, you know, type commands on their laptop.
- 34:53So that is a, exactly.
- 34:56Like they maybe don't know what the command prompt is at all.
- 34:58Exactly.
- 34:59It's very possible.
- 34:59Exactly.
- 35:00And when you're talking Excel and you're talking business users and you're intersecting those two things, there's a good chance that that intersection lands on Windows and not Mac.
- 35:09It's very unlikely it's on Linux, right?
- 35:11Absolutely.
- 35:11Yes.
- 35:12This portion of Talk Python To Me is brought to you by Stellarress, the AI-powered talent agent for top tech talent.
- 35:20Hate your job or feeling just kind of meh about it?
- 35:23Stellarress will help you find a new job you'll actually be excited to go to.
- 35:27Stellarress knows that a job is much more than just how it sounds in a job description.
- 35:32So they built their AI-powered talent agent to help you find the ideal job.
- 35:36Stellarress does all the work and screening for you, scouting out the best companies and roles and introducing you to opportunities outside your network that you wouldn't have otherwise found.
- 35:46Combining deep AI matching with human support, Stellarress pairs things down to a maximum of five opportunities that tightly match your goals, like compensation, work-life balance, working on products you're passionate about, and team chemistry.
- 35:59They then facilitate warm intros, and there's never any pressure, just opportunities to explore what's out there.
- 36:05To get started and find a job that's just right for you, visit talkpython.fm/Stellarress.
- 36:11That's talkpython.fm/S-T-E-L-L-A-R-E-S.
- 36:17Or just click the link in your show notes in your podcast player.
- 36:19What are the recommendations for making that work?
- 36:24Like Anaconda, things like this, or what do you suggest there?
- 36:27I'm a big fan of the Anaconda distribution.
- 36:29I tend to use Miniconda, so that's the more stripped-down version that has just not all of the libraries.
- 36:36Getting that installed on the system, it doesn't take as much space.
- 36:39And then adding in Pandas and all the other Jupyter notebooks and pieces that you need.
- 36:45My experience has been that it works really well on Windows, and that's probably the easiest way to get started.
- 36:52Python on Windows is getting better, especially if they have Windows 10, right?
- 36:56There's some pretty good stuff that's happening.
- 36:57Like you heard about Microsoft embracing Python more, right?
- 37:01We had Steve Dower on the show recently.
- 37:03He's one of the core devs at Microsoft.
- 37:05And he talked about how he got Python 3 in the Windows store, which I think is a big deal for business users.
- 37:12Absolutely.
- 37:13And then, you know, the other challenge, you've got this challenge of how do you get the users, but then there is kind of this internal corporate IT challenge some places where laptops could be pretty locked down, and you don't have administrative rights, and you can't actually install programs.
- 37:30I really am excited to see Microsoft's embrace of Python.
- 37:35And, you know, it's really funny to me.
- 37:38I think of Microsoft, you know, 20 years ago, and it was the evil empire and embrace and extend and extinguish.
- 37:43But now, I mean, they're really doing some great things.
- 37:45And what they're doing with Python, I think, is really good.
- 37:48And I think that really plays it well for these types of roles where people are using Excel and now Python, I think, truly is a legitimate option for them.
- 37:57Yeah, I do, too.
- 37:58And I think a lot of the lack of requiring admin rights, like, say, if you go in and you change your path or even just like techie, there's not even necessarily an admin operation, right?
- 38:09You could do that for your user profile, but go to the Windows Store, type Python, click that, and it's already in your path.
- 38:15You've already got Python, and Python 3 is a command, right?
- 38:17Like, that's another hurdle that they erased there.
- 38:20Exactly.
- 38:21It's pretty excellent.
- 38:22If the IT department starts to get upset about it, you can at least say, well, it is in the Windows Store.
- 38:26It's not like something that is just wild and free on the internet.
- 38:30Right.
- 38:31It's like, I didn't get that from some weird, like, mirroring site of, like, an open source link.
- 38:37And it looks super sketchy, but it is linked off of the main project site.
- 38:41So I'm going to kind of trust, like, it's not that, right?
- 38:43Exactly.
- 38:43It's not like trying to download Putty from some weird place or social course or something.
- 38:47And also, it runs with low privileges, right?
- 38:50It can't touch the registry.
- 38:51It can't touch the shared file areas, like the one that comes from the store, the Python from the store.
- 38:56So that's pretty good.
- 38:58Yes, absolutely.
- 38:59Yeah.
- 38:59But that said, that's a CPython pip world.
- 39:02That's not a Miniconda, Anaconda world.
- 39:04Like, would you still recommend people go down the Miniconda side for now?
- 39:07In my experience, you can install Miniconda without admin, right?
- 39:11So you install just as the local user.
- 39:13You know, I don't understand under the hood what the real difference is between that one and the Windows Store version.
- 39:19But I do know, like, my laptop is fairly well locked down.
- 39:23And I can install it and run.
- 39:25And it does everything I need.
- 39:27I haven't had to mess with the registry or any of the, you know, private Windows files.
- 39:31But for doing data analysis, replacing Excel files, it seems to work just fine.
- 39:35Yeah, for sure.
- 39:36So you're talking to these power users, and probably a lot of them, if they're Excel power users, it's very likely that they're kind of higher up in the organization.
- 39:45You know, how much of the conversation goes something like, oh, I should use Python?
- 39:50How much is that going to cost us for some corporate licenses to Python?
- 39:53And, oh, wait, it's open source.
- 39:55Should we be using open source?
- 39:56Like, is this a conversation that you have to have, or people just kind of brush it off?
- 39:59So I think it is a conversation you have to have.
- 40:03And I would say it depends on the organization and your role in the organization, how comfortable you are pushing the boundaries.
- 40:10So if you feel like, you know, if I do this, people are going to be okay with it.
- 40:15But if you're uncomfortable, you know, you definitely need to make sure you talk to the powers that be so that they can provide a little air cover if someone does get upset about bringing in this new Python tool into their ecosystem.
- 40:27Yeah, interesting.
- 40:28So I think it does help a lot that it's in the Windows store.
- 40:31And then we have Anaconda Inc.
- 40:32It's like official backers of sort of their distribution.
- 40:35And it gives it some legitimacy, I would say.
- 40:37Exactly, exactly.
- 40:39Yeah, all right.
- 40:39So let's suppose the listeners out there are like, I have this Python knowledge.
- 40:43I don't want to be asked to build another forms over a data app.
- 40:46I want to help these people do their world without me helping them out.
- 40:49You know, I want to teach them to fish, basically.
- 40:51How should they get started, right?
- 40:52Like, they sit down on Tuesday and they say, hey, let me show you something.
- 40:56Let me get started.
- 40:57Like, what do you think?
- 40:58Yeah.
- 40:58Some steps there.
- 40:59Sure.
- 41:00It is a hard part because there's not just the one place to go to say, hey, here's how you learn Python and the appropriate tools to solve your problem.
- 41:09So what I think works best is people might have the natural reaction.
- 41:14I want to focus on this really painful problem I have.
- 41:17It's a really big problem.
- 41:18It takes a lot of my time.
- 41:19It's very error prone, whatever.
- 41:21I would say actually start with something that's maybe a little simpler, that's very well understood, and try and automate a simple process and just get the basics down before you move on to the more complex stuff.
- 41:36So maybe there is a process where you're moving some files around or opening up Excel and copying and pasting a few rows or columns from one to another.
- 41:47Start with that and just kind of get that going and show them how to set up on their system, how to read in a file, how to make a couple changes with the data frame, with pandas data frame, save it back out, and just start there.
- 42:02And try and do something in 10 to 20 lines of Python code to get the ball rolling.
- 42:09Yeah, that makes a lot of sense.
- 42:10And I do think it's these little, almost death by a thousand paper cuts type of problems that if you can just solve some small to medium ones, but they become repeatable.
- 42:21If they could be scheduled, if they could become automatic.
- 42:24So you just had an email when you came in on Monday instead of you doing the report and sending it to the people who need it.
- 42:30It just happens automatically and you get a copy on Monday.
- 42:33Those kinds of things are pretty easy to attack.
- 42:36But I think a couple of those and then the joy would start to spread.
- 42:40You're like, you know what?
- 42:40This is awesome.
- 42:41What else can I do with this?
- 42:42Right?
- 42:43Exactly.
- 42:43Exactly.
- 42:44And then what I found too is sometimes maybe there's a report that you do once a week, but it's automated now so you could do it daily.
- 42:52And suddenly people are like, oh, wow, daily.
- 42:55Yeah, this is really useful.
- 42:56So it's not just the benefits of time savings.
- 43:00It's the benefit of like now it's easy for me to do, so I'll do it.
- 43:04Whereas before, if it took me several hours to pull something together, I'm probably not going to be willing to do that every day just because I don't have the time.
- 43:12So I think there are a lot of unintended benefits of doing automation.
- 43:17For sure.
- 43:17And like the next step from there is on demand.
- 43:20Exactly.
- 43:21Right.
- 43:21Like you want to know what the weekly sales rate versus last week were store by store?
- 43:28You just click here and then you have it in a minute.
- 43:30You know?
- 43:30Exactly.
- 43:31Exactly.
- 43:31And you're right.
- 43:32I mean, you kind of get this momentum.
- 43:34It builds on itself.
- 43:35So once you've taken something simple and gotten started, then, oh, I want to tweak it a little bit.
- 43:41That's where you also see the value is.
- 43:43I'm not starting from scratch.
- 43:44I can take what's already there and maybe just add some additional code or use that as a basis for a new process.
- 43:51It just starts to build and you kind of get this library of tools and ways to manipulate the data and report the data out that just really, you know, accelerate your speed to get things done.
- 44:03Yeah.
- 44:03It's obvious to us as programmers, but if you always have to get the data from one place and maybe you have to do different stuff with it, once you write that part to get the data once, like that is done, right?
- 44:12That is a solved problem.
- 44:13Now you build on top of that capability, right?
- 44:16And I'm sure a lot of folks that were addressing, you know, like talking about helping them here, they just don't have that mindset of if I solve it in one way, that solution is reproducible and reusable, right?
- 44:26Right.
- 44:26And that is a challenge, right?
- 44:28So anyone that's learning this new tool, they're going to be slower in the beginning and they're going to have to invest time.
- 44:36And, you know, in my experience, I've had to learn a lot of this off hours.
- 44:41It's not something that you just can get done in an eight hour day.
- 44:45And so there is a little bit of a targeting of that individual.
- 44:48Is this individual at least open to trying to learn some on their own so we can point them in the right direction and they can learn about Python?
- 44:56They can learn about these tools, but are they going to be able to follow up on their own or are they just going to say, I need you to do it for me?
- 45:03If that's the case, they're probably not the best candidate for this.
- 45:06Right.
- 45:06Right.
- 45:07I mean, it seems to me like if you're doing some sort of four hour task weekly and there's somebody who's going to help you, they could sit down and say,
- 45:14instead of doing that manually, why don't we spend those four hours on Monday, build it together?
- 45:20I mean, this is not me offering to be your private software developer, but this is me helping you down this path.
- 45:26I'm sure that we could do this in four hours.
- 45:28Let's sit down and do it together.
- 45:29So you understand it and then you can take it on and sort of keep it going.
- 45:33You know, I think things like that may work.
- 45:35Yeah, absolutely.
- 45:36And then, you know, one of the things that I've wanted to do, but I haven't really done a whole lot of is, you know, what kind of user groups can you set up in your company so that you have some of these resource, peer resources to help them work through the process?
- 45:51Your podcast about the Apple Python training was really, really interesting and, I mean, certainly a much larger scale than what I'm talking about.
- 45:59But I think that that would be another option is to try and get four or five dozen people like-minded individuals together and over the lunch hour start to introduce these concepts and build a community where they can learn and share their learning.
- 46:13That's a great idea to kind of have all these Excel power users who are escaping Excel through Python start to come together and give a little presentations like, yeah, last week I did this automation and let me just talk to you about how it worked and what I had to overcome.
- 46:27And yeah, that'd be great.
- 46:28Exactly.
- 46:28Yeah.
- 46:29And because what I think will happen is there are a lot of common challenges.
- 46:33You know, how do I get access to this database or how do I massage the data in a certain way that is probably fairly common in an organization?
- 46:43So if you can share that, you know, or like simple things like I've got to do a lot of PDF file manipulations.
- 46:50Okay.
- 46:50What library are you using?
- 46:52What are some of the ways to do that?
- 46:54I think there's a ton of those types of leverageable problems across an organization.
- 46:59As soon as someone finds the solution to getting that table out of that PDF document, other people are like, I have to copy it out of the PDF document.
- 47:07What are you doing?
- 47:07Right?
- 47:07This is cool.
- 47:08Exactly.
- 47:09Exactly.
- 47:10Yeah.
- 47:10I guess you probably got to set expectations as well, right?
- 47:14Like you can't say like, look, I know you've got super cool apps on your phone and you've been to Airbnb.com.
- 47:20This is not what we're talking about.
- 47:23What we're talking about is a few steps reproducibly really quick that you don't like just setting the expectations of you can't start by building, you know, like some kind of super glamorous app.
- 47:34Absolutely.
- 47:35It's a really good point.
- 47:36And that is one of the challenges is the, as much as we rail on Excel and maybe access, which we haven't talked about, but similar sort of thing that, you know, it's still really intuitive for someone new to pick it up and do something.
- 47:52And, you know, you can get results and it looks pretty, like you said, whereas are people going to be impressed that I ask you to open up the command prompt and type Python, this, this, and this, and then a file is output somewhere.
- 48:05I mean, it doesn't have that wow factor that you would with more of a, you know, a GUI type application.
- 48:12And so I agree a hundred percent that you need to be able to get people comfortable with what you really can and can't do.
- 48:18Right.
- 48:18Right.
- 48:19So it feels like success, not failure when it's working.
- 48:22Right.
- 48:22Exactly.
- 48:23Exactly.
- 48:24I think there are a few simple things you could do to help.
- 48:27Like right now, as our discussion is gone, like the solution is I go to the command prompt, I type Python, maybe Python through space, the script that does the magic.
- 48:37Maybe I set up a windows task scheduler that does that for, I don't know, some, some way that that thing is running.
- 48:43Right.
- 48:43But it's basically a command CLI type of experience.
- 48:46You know, you could use something like GUI, G-O-O-E-Y, which is a really simple way to turn a CLI interface into a GUI cross-platform interface, like a GUI GUI.
- 48:57Yep.
- 48:57And the other one that you brought up that's pretty straightforward is Jupyter Notebooks.
- 49:02Yes.
- 49:02Yes.
- 49:03Right.
- 49:03Do you think that helps a little bit with the acceptance layer?
- 49:06Like you can visualize a graph, right?
- 49:07You could do a bokeh or matplotlib thing.
- 49:10Absolutely.
- 49:11And it's interesting you mentioned GUI, which, you know, is hard to talk about, but when you see it, you understand what it is.
- 49:18But I wrote an article about it and I've used it a lot.
- 49:22And it is, I think it's a fabulous tool for people that have, you kind of have this command line and trying to teach people how to use a command line can be frustrating.
- 49:31But GUI, you can just easily put that on top of it.
- 49:34And especially where it's like selecting files, selecting dates, selecting a couple of values from a dropdown.
- 49:40Got some combo box, exactly.
- 49:42The dropdowns.
- 49:43Yeah.
- 49:43Exactly.
- 49:43It's so easy, right?
- 49:44It is.
- 49:45And the other thing is it's WX Windows, so it looks native.
- 49:49You know, it's not an ugly GUI.
- 49:52And I personally use that when I put some things together and people just know how to use it.
- 49:58And they don't really care what you did, just that, oh, it looks like I would expect a Windows app to work.
- 50:03So that's great.
- 50:04Yeah.
- 50:04The fact that they have a thing, they double click.
- 50:07If you use Pi Installer or Pi Oxidizer or something, you get like an EXE or a .app file.
- 50:12You just, you put it in your doc or your taskbar, you double click it.
- 50:15Like all of a sudden, it's almost a first class citizen in your world.
- 50:18Exactly.
- 50:19Yeah.
- 50:19Yeah.
- 50:20Totally.
- 50:21And then Jupyter Notebooks, I think, are certainly another option.
- 50:24I don't have experience with like building a Jupyter Notebook hub that you would share out with everybody.
- 50:30But I do agree that having that where you tell people, okay, run the notebook, go here in your browser, use some of the widgets to populate some information.
- 50:37I think that's absolutely a valid option.
- 50:40Yeah.
- 50:40It seems like that would really help with the acceptance.
- 50:44You're like, okay, this is not so scary.
- 50:45It's not the terminal or command prompt, which I know in reality, it's like not that big of a deal.
- 50:52But psychologically, it's a massive deal for some people, right?
- 50:56Like they're just like, oh, forget that.
- 50:58This is not the way we work here.
- 51:00This is not the way.
- 51:01Exactly.
- 51:01And actually, where I see Jupyter Notebook, what I have been trying to do is almost like when I have a data challenge.
- 51:10So I get an Excel file or I need to do a project.
- 51:12And I wrote about it on my blog.
- 51:14I have a cookie cutter that creates like a couple standard Jupyter Notebook directory or directory of some Jupyter Notebooks, stubs, and my in and out directories and the raw data file.
- 51:24And so it's a consistent methodology.
- 51:28So I know if I go back six months later and open it up that I have kind of that Jupyter Notebook history of what I've done and all the files are where I expected.
- 51:37And I put notes in there about where the files come from and what am I trying to accomplish and, you know, all those kinds of things.
- 51:43And I think Jupyter Notebook could really be useful for that type of analysis.
- 51:48Instead of in my perfect world, instead of reaching for Excel every time you need to do analysis, hey, I'm just going to use a Jupyter Notebook to start looking at the data and treating it, you know, almost like a data science problem versus I'm just going to, you know, hack together something in Excel.
- 52:03That's really cool.
- 52:04I love the cookie cutter idea as well.
- 52:05It's nice.
- 52:06Yeah.
- 52:06And it's really worked out well.
- 52:08Once I've started to use it and now I've been using it for a few months and go back and look at projects where I've used the cookie cutter strategy.
- 52:16I'm like, oh, yeah, this is really cool.
- 52:17I kind of know where everything is and I know what to expect.
- 52:21And I can then create that feedback loop where there are maybe snippets of code that I want to include in future ones.
- 52:29So you can just kind of keep populating that cookie cutter with the most recent code.
- 52:34That's right.
- 52:34You take your learnings from the last one and you kind of make the project a little bit better, a little bit better, a little bit better.
- 52:39Exactly.
- 52:40You know, and the other thing we talked a lot about Excel, one of the things that I think is I've, you know, started to learn more about data science and use some of these tools.
- 52:51And there is a different approach to looking at data when you look at it almost from this data science approach versus looking at it from Excel and the data science approach of you do exploratory data analysis on the data set.
- 53:04And you start to learn things that are easy to do with the pandas data frame that are maybe hard to do with Excel.
- 53:09So just simple things about like, where are my null values?
- 53:13Where do I have duplicates?
- 53:15Where, you know, where is maybe the data not as clean as I would expect?
- 53:18You can kind of go through that as part of that process that I think is maybe a little more robust, a little more natural for data analysis than just trying to open up an Excel file and do a bunch of auto filters and pivot tables.
- 53:32Yeah, and it doesn't matter how big the data is or how wide it is.
- 53:35Whereas in Excel, it's like, you kind of got to live visually in the data.
- 53:39You know what I mean?
- 53:40You're like, you got to have your charts and stuff swim there rather than it's fine.
- 53:45It has 200 columns.
- 53:46You know, we load it and it's just like you show it below where the data went, right?
- 53:49It's all good.
- 53:49Yeah, exactly.
- 53:50And I think it also starts to, you start to learn the data science concept.
- 53:54So the concept of tidy data, you know, is certainly something I never really understood just as an Excel user.
- 54:01Yeah, define that for us.
- 54:02So essentially, I knew you were going to ask me that.
- 54:05Now, I should have looked up a better definition.
- 54:07But instead of when you have a row of data, it's like a single observation in that row versus having multiple columns of data.
- 54:17So think about like if you're observing cars passing on the street, you would have a car and then maybe you'd have the make and the model versus multiple columns with all the different makes and models and yes, no's in each column.
- 54:31And the reason it's important is a lot of these data science tools then make it very easy to manipulate and more importantly, visualize the data when it's in tidy format.
- 54:42And once you get it in that format, then suddenly the opportunities for visualization that are available to you are really powerful that you just can't do in Excel very well.
- 54:52Yeah, that's cool.
- 54:53I see a lot of interesting things sort of coming from this, right?
- 54:56Somebody moves a little bit out of Excel, they kind of get in with Jupyter, they kind of learn Pandas.
- 55:02And all of a sudden, they start thinking, you know what, how hard would it be to train a machine learning model to predict rather than just a report, right?
- 55:11Exactly.
- 55:11There's just a few little steps.
- 55:13Yeah.
- 55:13Those things are not that hard, but you need tidy data and you need like good, got to get the right factors or aspects of your data you want to feed to the model and all that kind of stuff, right?
- 55:22Absolutely.
- 55:22And you know, one of the things that I put in the notes for us to talk about was Facebook's profit tool.
- 55:29Yeah, tell us about that.
- 55:30I think this is a really interesting example of a really powerful tool that lots of analysts need.
- 55:38And if you just learn a little bit of Python, you can do some really cool things.
- 55:43So the project for those not familiar with this, it's an open source project that Facebook put out, I don't know, a couple years ago.
- 55:50And it's a tool for making predictions about time series data.
- 55:56So think about if you wanted to predict, like how many hits are you going to have on your website in the future?
- 56:02Or, you know, their example is about hits on Wikipedia hits on Peyton Manning is the thing that they walk through.
- 56:09But I think any organization is going to have a lot of, can you predict the future?
- 56:14Can you predict what we need to manufacture?
- 56:16Can you predict what our sales are going to be like?
- 56:18Can you predict what this marketing campaign is going to do?
- 56:21Yeah.
- 56:21Imagine you were the person who had that answer.
- 56:23Yeah, exactly.
- 56:25Right?
- 56:25You would just be like, you're the magician.
- 56:27Exactly.
- 56:28And what I think, what I suspect happens is, you know, most big organizations, maybe in supply chain, you do have someone that is really smart on this type of prediction.
- 56:38But you have to predict all across the organization.
- 56:42And so what do most people do?
- 56:43You know, you plot out your history and maybe you kind of do some sort of regression line and kind of make a guess.
- 56:49But if you start to look at all the different mathematical options you have for predicting time series data, it's mind boggling, right?
- 56:57Like, how could you figure all that out?
- 56:59So Facebook essentially had this problem.
- 57:01So they built this library where they put some fairly sophisticated math behind it, but a very simple API where you can only change a few variables and get some really nice predictions and some really nice visibility to the trends in your data.
- 57:19So I've been really impressed with it and think it's a really cool tool because it strikes a really nice balance of power, but easy to use for someone that's not a, you know, PhD math professor.
- 57:33Yeah, that's cool.
- 57:33And it seems like it's a good fit for the people we're talking about in the show.
- 57:37Yeah, absolutely.
- 57:37Yeah.
- 57:38Nice.
- 57:38All right.
- 57:39We're getting a little short on time, but I do want to ask you a few more things real quick before we go.
- 57:42Let's close this out.
- 57:44Like we talked about all the benefits.
- 57:45We talked about all the good things here, but maybe let's just talk on a few areas on what Python needs to do better to better take advantage of this group and just go farther.
- 57:55Sure.
- 57:56So a couple of things.
- 57:57So we did have a good discussion about should we use Miniconda?
- 58:01Should we use Python from the Windows Store?
- 58:03You know, I think that is still a good area for us to figure out, you know, what is the preferred way to get Python out and then install it on a system?
- 58:11And then more importantly, how do you keep it updated?
- 58:14There's still some kind of wonkiness between installing with Conda and Pip, and I've been bitten by it before where suddenly I'm installing with pip and it's unwinding some of my Condas install.
- 58:27And that is something that a new user is not going to figure out.
- 58:32That's not going to be okay.
- 58:33Yeah.
- 58:33No.
- 58:34So I think that's something that needs to be solved.
- 58:38And I know folks are working on that.
- 58:40I think the other one is this whole, like we talked a little bit about data visualization and it could probably be expanded more broadly is like once you start getting into Python, there are some areas where it's hard to make a decision about which direction I should go.
- 58:55So data viz is a great example.
- 58:56Like I want to plot something.
- 58:58What do I do?
- 58:59Do I do a matplotlib?
- 59:00Do I do bokeh?
- 59:01Do I do seaborne?
- 59:03You know, all the various options.
- 59:05You come from having one choice, the little charts, insert chart drop down to the paradox of choice of open source, right?
- 59:12Exactly.
- 59:13Exactly.
- 59:14And then I think the other one, and I know you've talked about it a little bit, is the whole distribution problem.
- 59:19So how do you get these Python scripts, programs, notebooks, whatever they are out there so that other people can use?
- 59:29And do you have to go through some sort of EXE conversion?
- 59:33Do you have to have some other way to distribute the files?
- 59:36You know, in my mind, Envision, wouldn't it be cool that you had kind of a little launcher type thing that would go and check and download the most recent files and put a little GUI around it?
- 59:45But something like that needs to be in place.
- 59:48Otherwise, you're going to have a whole different type of maintenance nightmare.
- 59:52Yeah.
- 59:52I mean, we talked about GUI and PyInstaller, but these are sort of not super perfect projects.
- 59:59They're great.
- 1:00:00They're really awesome that they exist, but they're not a general solution.
- 1:00:04Right.
- 1:00:04Right.
- 1:00:05And that's the reason Excel works so well, is I can put an Excel file together.
- 1:00:10And once I give you that Excel file, for the most part, it's going to work because it's got all that Microsoft Office guts behind it.
- 1:00:18Yeah, absolutely.
- 1:00:19All right.
- 1:00:19One other thing.
- 1:00:20Are you familiar with the Microsoft user voice where they ask for features and they have one on Excel, one where somebody suggested that Python replace VBA as the Excel scripting language or maybe in addition to?
- 1:00:32Have you seen this?
- 1:00:32I've seen that.
- 1:00:33Yes.
- 1:00:34Yeah.
- 1:00:34And there's a lot of excitement.
- 1:00:35Yeah.
- 1:00:35It blew up.
- 1:00:37I mean, there's like 5,800 votes and just people going, wow, please, please, please make it happen.
- 1:00:42You know what I mean?
- 1:00:43And I'm probably like most people.
- 1:00:45When I first saw it, I thought, wow, this is awesome.
- 1:00:47Wouldn't that be perfect?
- 1:00:48But the more I thought about it, I don't know if that's really a good thing or not, because it probably depends on the implementation.
- 1:00:55And I'm not smart enough to understand how they would do it.
- 1:00:58But like, I think like we talked about the power of Python is the ecosystem.
- 1:01:03And so that I can use conda or pip to install something like, am I going to have all that available to me in Excel or would it just be?
- 1:01:11Yeah, that's really interesting.
- 1:01:12I mean, you can, I think you can embed like DLLs into Excel through like .NET.
- 1:01:19And then there's Python and SQL Server.
- 1:01:21There may be a way.
- 1:01:22But, you know, as you say that, I also kind of think some of the advantages we spoke about, version control, like not a whole bunch of go-tos, but straightforward code.
- 1:01:30You know, like all those things would still be absent, right?
- 1:01:32So I'm kind of on the fence as well.
- 1:01:34I mean, I'd sure rather see Python than VBA, but maybe VBA is needed there to chase them out of that area into a better place.
- 1:01:41Yeah, I think so.
- 1:01:42But we'll wait and see.
- 1:01:43I don't know if it's, they're making progress with it or not.
- 1:01:46Yeah, I don't know.
- 1:01:47My feeling is there's not a lot of action.
- 1:01:49There's kind of like, wow, people really want this more than we thought.
- 1:01:52I don't know if we want to do this, but that's just my looking from the outside.
- 1:01:56I agree.
- 1:01:57I agree.
- 1:01:57Cool.
- 1:01:58All right.
- 1:01:58Well, Chris, it's been great to talk about.
- 1:02:00Before you get out of here, let me hit you with the final two questions.
- 1:02:03If you're going to write some Python code, what editor do you use?
- 1:02:05Mostly I'm Sublime or Jupyter Notebook.
- 1:02:09Okay.
- 1:02:09Yeah, that's a good fit.
- 1:02:11And then notable PyPI package.
- 1:02:12Yeah.
- 1:02:13We talk quite a bit about Pandas.
- 1:02:15You know, I'm a huge, huge Pandas fan.
- 1:02:17I assume most of your listeners are familiar with that.
- 1:02:20But I'll put a plug in from a data viz perspective.
- 1:02:24So I've been using Altair quite a bit recently.
- 1:02:27And I know you've talked about it a little bit.
- 1:02:29And I'm really starting to like that package.
- 1:02:32It seems to fit well with the types of business analysis that I'm involved with.
- 1:02:37Still enjoy Seaborn for some of the more complicated statistical analysis.
- 1:02:42Altair is pretty cool.
- 1:02:44And I'm hopeful that it will continue to develop and, you know, get more and more powerful and
- 1:02:50more used.
- 1:02:50Yeah, for sure.
- 1:02:51It looks really cool.
- 1:02:52And there's some nice stuff.
- 1:02:53And also shout out to Altair recipes.
- 1:02:55So like quick little things you can use.
- 1:02:57That's a nice project to even make it simpler, right?
- 1:02:59Yes, absolutely.
- 1:03:00All right.
- 1:03:01Well, final call to action.
- 1:03:02People surely work in their company with folks who have this Excel hell problem.
- 1:03:07What do you tell them?
- 1:03:08Yeah, you know, reach out to if you know Python and you're in a big organization, there's probably
- 1:03:13people out there that could really benefit from your knowledge.
- 1:03:16And you don't necessarily need to quit your day job, but reach out to those folks, spread
- 1:03:21the word a little bit about Python and be good resource for them to get up to speed and
- 1:03:26understand what Python can do for them.
- 1:03:27Yeah, awesome.
- 1:03:28I agree.
- 1:03:28I think you can make a huge difference by writing software, but sort of empowering these
- 1:03:33folks to go explore what they got to do.
- 1:03:35Yeah.
- 1:03:36And be patient as they learn.
- 1:03:38Yeah, absolutely.
- 1:03:40Be patient.
- 1:03:40It's going to take some, but I'm sure it's worth it.
- 1:03:43All right.
- 1:03:43Thanks for being on the show.
- 1:03:44It's great to chat with you.
- 1:03:45Thanks a lot.
- 1:03:45I appreciate it.
- 1:03:46Yep.
- 1:03:46Bye.
- 1:03:46Bye.
- 1:03:46This has been another episode of Talk Python To Me.
- 1:03:50Our guest on this episode was Chris Moffitt, and it's been brought to you by Linode and Stellaris.
- 1:03:56Linode is your go-to hosting for whatever you're building with Python.
- 1:03:59Get four months free at talkpython.fm/Linode.
- 1:04:03That's L-I-N-O-D-E.
- 1:04:05Find the right job for you with Stellaris, the AI-powered talent agent for the top tech talent.
- 1:04:11Visit talkpython.fm/Stellaris to get started.
- 1:04:15That's talkpython.fm/S-T-E-L-L-A-R-E-S.
- 1:04:20Stellaris.
- 1:04:20Want to level up your Python?
- 1:04:23If you're just getting started, try my Python Jumpstart by Building 10 Apps course.
- 1:04:28Or if you're looking for something more advanced, check out our new async course that digs into
- 1:04:33all the different types of async programming you can do in Python.
- 1:04:36And of course, if you're interested in more than one of these, be sure to check out our
- 1:04:40Everything Bundle.
- 1:04:41It's like a subscription that never expires.
- 1:04:42Be sure to subscribe to the show.
- 1:04:45Open your favorite podcatcher and search for Python.
- 1:04:47We should be right at the top.
- 1:04:48You can also find the iTunes feed at /itunes, the Google Play feed at /play, and the
- 1:04:54direct RSS feed at /rss on talkpython.fm.
- 1:04:57This is your host, Michael Kennedy.
- 1:04:59Thanks so much for listening.
- 1:05:01I really appreciate it.
- 1:05:02Now get out there and write some Python code.
- 1:05:04I'll see you next time.