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

14

u/[deleted] Sep 18 '23

[removed] — view removed comment

2

u/Sonoshitthereiwas Sep 18 '23

Ahm, given that it is hard, a course on this could help tremendously. You can search for courses or book related to data analysis or pandas itself, and it will help you tons.

"I'm going back through and trying to recreate much of the items we went over to make sure I 'get it'." This makes me think that the courses you're looking at are not deep enough, or didn't give enough examples for you to work with, this makes learning harder to do!

The course (it was actually 10 courses in DataCamp)was not meant to make anyone an expert. The way DataCamp works is it has about 5 minute video explaining something and then you do it. The problem I have is I don’t learn well from videos. But the course had a timeline to complete, so I completed the course. About 40 in total of those.

Now, I’m actually going back through using the transcripts to read what we did and then recreate it. I just went back through the first one and realized I completely missed how you can only use certain things with certain objects, like using .index() or .count() works with a list versus capitalize() or replace() works with str. Because it was a video and I don’t process audio well I completely missed it.

Besides that, there's also the aspect that you're learning to use a new programming language too, and, if you don't know it, you're bound to go slow and sometimes do things by trial and error, or by copying an answer that works somewhere else, so this is another painful point.

You’re right. And the reminder is a good one. Im just use to being “the nerd” in the room, and it’s a struggle to be the slow one.

"that basically means I need a separate log of anything I'm doing before I do anything" - that is very common, I do it almost every day, and the more complex or the less I know about something, the more I do it! So, it's normal, don't worry.

This makes me feel a little better 😅

• ⁠Ah! And, if you aren't interested in Python per se, but only dealing with data, I recommend R, which is very intuitive to use (tidyverse... chef's kiss) and in my opinion has a smoother learning progression than pandas itself. R is a language specifically designed for data, so it shines in this aspect!

Unfortunately, I’m in a Master program that uses Python which is why we’re learning it. Most of the people I’m in class with already have experience with it, at least to a small degree. Im a fair bit older than most of my ‘classmates’, so trying to do a kind of catch up.

Im hoping understanding Python will translate to helping me learn R after this program.

PS: About the keeping track of things, use Jupyter notebooks if you're not doing so yet. And, if the data is not clean, the first step is usually understanding what is not clean and then dealing with it.

Im using Anaconda, and Jupiter is in there, I just haven’t touched it yet. I was thinking I’d learn and practice the basics first, then jump into Jupiter. Maybe I’m trying to jump ahead without realizing it.

Cheers, and good luck on your journey!

Thanks 🙏

4

u/[deleted] Sep 18 '23 edited Sep 18 '23

[removed] — view removed comment

2

u/Sonoshitthereiwas Sep 19 '23

Thanks much, it really is very appreciated

1

u/Past-T1me Sep 19 '23

Also reinforcing the point to use Jupiter notebook, it makes things so much easier. If you have git bash, you just right click where you want to open it(like a work folder) type Jupiter notebook in the git console and it opens up folder/files in a UI you just click which you want open. Jupiter also has cells that lets you run completed blocks of code whenever you want. Really helps for trying to figure out where something went wrong and isolating that piece.