r/learnpython • • Sep 18 '23

Why does Python seem so complicated?

First, a little background. I've been using Excel for ages now, about 15 years now with a large increase in the last 5 years. Mainly functions and visuals, a small bit of optimization and a tiny bit of VBA. I'm more than comfortable with vlookup, and our work computers aren't updated so I haven't had much opportunity to use xlookup. I've made things with the sort, filter, and offset function to include conditional formatting as study aides for GRE study resource. Within my current field, I'm considered a wizard, however, against true wizards I'd be a novice. But I can use it very efficiently and relatively easily.

I'm in the process of switching careers, and as part of that I'm learning Python. I'm in a course that had us do some courses in DataCamp to help learn Python. I completed the courses, but it was mainly brute forcing my way through. I'm going back through and trying to recreate much of the items we went over to make sure I 'get it'.

I've been using ChatGPT to help me along the way, and I can generally get what I need, but I have no understanding of what I'm actually doing. And that's my problem. In Excel, I understood exactly what I was doing and could effectively trouble shoot any issue I ran into.

With Python, I'm stuck using ChatGPT, and if ChatGPT can't solve it then I can't seem to do anything. It just doesn't make sense to me. I have numpy, pandas, openpxl installed. I even tried doing some web scraping with selenium, which I was able to get it to open a web page, but nothing beyond that. That one I was definitely reaching too far on, and I get that, but I use it to show I feel like I'm a decent trouble shooter.

Maybe I'm overestimating my abilities, but I just cant get an understanding of how to effectively use Python. I feel like I have to envision every single aspect of what I'm doing, and as someone who isn't a very visual thinker, that basically means I need a separate log of anything I'm doing before I do anything. And the feels anti-productive.

I loaded a file into Python and there are two columns of data I was trying to turn into arrays. That took me like an hour to get done and I ended up turning them into values rather than arrays. Actually, I suppose it was a bit of both, but it just seems needlessly complicated to try and understand what I'm doing.

How do you keep track of what you're doing? Using things like .head I thought might be helpful, but there are mixes of blank and empty data. It has over 2000 rows and a quick visual of it makes it even more complicated to look at it. Is it best just to accept I'll use ChatGPT without understanding?

0 Upvotes

47 comments sorted by

View all comments

5

u/Naive_Programmer_232 Sep 18 '23 edited Sep 18 '23

Well the jump from excel to a programming language is big, in that with excel you get this full blown application that understands how to do all these things so you can get more done with less, but with python and other programming languages, it's more or less like a big tool box of a bunch of loose parts you figure out over time how to connect to get shit working. Some struggle is to be expected though, you gotta learn how to think when it comes to code, its a different mind set. Each thing that seems practical in excel to use, is going to need to be broken down step by step into pieces where you'll have to call certain functions / methods and so on in order to do 1 thing. That's just how things tend to be organized and compartmentalized in code, its like taking a big project and breaking it all down into small pieces, and the code you look at is how all those little pieces connect.

I wouldn't memorize. Not saying to not rely on chatgpt either because it's a great tool and should be used. But another thing you could do, which helped me in the end, is learn how to read documentation and look stuff up. A lot of times, when you watch tutorials and their using libraries and its doing so and so, etc. these people are referring to documentation before hand so they know what to say in the video lol. They aren't guessing at what something does and coming up with some theory of how it works. They're digging into documentation and seeing it for themselves from the providers of the tool. So, that could be something you could try to incorporate, use tools like the help function even to get an idea of how things look in documentation, learn the conventions, what things are called, and how to look stuff up and interpret. Over time, you'll naturally memorize some of this, but try not to make it a goal to memorize all of it, because it's all there, just waiting for a google to see the docs ya know. You don't have to waste your time with it, because if you need the tool, you'll have to look up the docs anyway. Its a good thing to get into the habit of.

Lastly, be practicing frequently. Don't just sit there and watch video after video without applying it, cause it probably won't stick. And it sounds like you're already doing this, which is good. But just keep at it and challenging yourself. Over time, you'll narrow down a grind that works for you and you'll learn how to learn better

3

u/Sonoshitthereiwas Sep 18 '23

Practice is exactly my hurdle. That’s why I’m loading data from excel using pandas. I’m using some of my old datasets to practice recreating. This way I know what the outcome is supposed to be.

The DataCamp environment comes preloaded with data, but I can’t recreat that and that’s part of my struggle. I don’t learn well from videos at all. I feel like I can modify code, but I can’t write or create code.

I also might be overestimating my abilities because I’ve only seen code that’s maybe half a page to a page long.

You’re right though, I guess I just wasn’t expecting this big of a jump. Because I keep hearing how intuitive Python is, but with a background in Excel it just doesn’t feel intuitive to me. And this makes me question if I’m doing something wrong or just inept.

But I think I just need to take a step back and just kind of keep hammering away. I think it might be a good idea to modify my datasets though. All of the data I received in the last required significant cleanup and that just doesn’t work here. At least not yet and not at my level.

Thanks