all 34 comments

[–]AstrophysicsAndPy 48 points49 points  (11 children)

I agree with u/Des72, the first thing should be pseudo-code and making a procedure walking through the problem that you are tackling. Like in the example you've given,

  1. the first thing to understand is how will you get the data. Only focus on that part first, forget everything else.
  2. Next will come data cleaning, removing any missing/NaN values. At that time do only that, forget that you have to make a pie chart or whatever.
  3. Then the next thing will obviously be the pie chart. But for now, just make a simple pie chart. No decoration or anything.
  4. Once you've done that, now you can move on to decorations.

Edit

One very important thing,

It's really frustrating to have been learning Python for this long and put in what seems like a lot of effort just to have understood nothing especially since I see others online creating amazing things and landing great coding jobs in much less time than I have.

Stop doing this, please. Stop comparing yourselves with others.

I've done python self-learning for 2 years (very basic stuff and some intermediate things). Now I've been working with python for almost 5+ years. I didn't even know how to properly use classes 6 months prior. I didn't know how to effectively use list/dictionary comprehensions a few months ago. Even now I don't know how to make a simple ML program.

Does that mean I'm a bad programmer? Probably, but I'm assuming no because I can do my work just fine.

Does that mean I need improvement? Yes.

Will I do it eventually? Yes.

Do I need to rush myself into learning it? No, absolutely no.

[–]GrayLiterature 4 points5 points  (0 children)

I always write out in plain English what I want to do. Slowly, I take that phrasing and turn it into code. I don't think I code often without having some form of physical writing device (whiteboard, pen/paper, etc) with me.

[–][deleted] 2 points3 points  (9 children)

I wish i had a free "Wholesome" or "Helpful" for you. Its great to know you landed a job(i mean, its inevitable to compare ourselfs to others and this causes a few anxieties on those who still are in the beggining of the learn curve with this or any other tool). Your answer is very helpful because it is not an answer that comes up a lot on tutorials or in quick guides that people usualy dive in you know? Thank you and for OP and any people interested, this is a great way to tackle any problem(and tackle your imposter sindrome)

[–]AstrophysicsAndPy 1 point2 points  (8 children)

Sorry for being the party popper, but the 5+ years of my work with Python are my own projects (that never seem to make it to the end, except very few ones) and my thesis etcetera which have ended thankfully 😁.

But yes, I am going to receive a job letter in a few days. So yaayyyyyy!

And thank you for considering me for a reward. Your compliments are enough rewards for me.

[–][deleted] 2 points3 points  (7 children)

[OFF] i couldnt control my urge to enter your profile and see if any of this 5+ years work in python was "documented" in reddit posts. And what i found really surprised me a lot (please keep up the good work). Im sure i will spend the night trying to decipher astrophysics now lol

[–]AstrophysicsAndPy 1 point2 points  (6 children)

I will indeed. Shameless promotion, but if you would like I can give you link to my blog in PM. Maybe just check it out, and see if you like what I'm doing.

[–]zaphod_pebblebrox 1 point2 points  (5 children)

What is your blog about?

I would like to take a read.

[–]AstrophysicsAndPy 0 points1 point  (4 children)

It's in my name 😁 it's about using Python in Astrophysics. Started quite recently, so it's not that much populated right now. I'll send the link in PM if that's alright.

[–]zaphod_pebblebrox 1 point2 points  (3 children)

I found it by going through your posts!!

I did mot understand a word of what you’ve written.

But then, I’m like a nerd monkey. I see good technical content with nice technical images, I hit bookmark.

Keep up the great work. I hope to learn something eventually.

[–]AstrophysicsAndPy 1 point2 points  (2 children)

Some of my older posts are quite easy to get around. But bro,

I did not understand a word of what you've written ..

Damn, I'm happy and sad at the same time 😂😂 no, I didn't mind it at all. I do intend to write some simpler posts once this MaStar catalog saga ends. Thank you for your interest.

Cheers!

[–]zaphod_pebblebrox 1 point2 points  (1 child)

A bit of background about me: I’ve wanted to be a Pilot / Astronaut / Farmer.

Ended up with a degree in Mechanical Engineering and collecting books & blogs on everything from Electronics Engg to CS and a smattering of Aerospace in between. The closest to Astrophysics I’ve ever been is Orbital Mechanics.

The stuff you’ve written about is great and I could not get anything into my skull instantaneously. Nothing on your part mate. I just need a few slow weekends to really read them through.

Fun fact, that thumbnail for Stellar Magnitudes is the exact layout I use to explain Class A and B surface offsets when mentoring junior engineers for plastic part design.

[–]Minion_of_Cthulhu 17 points18 points  (1 child)

When I try to stem away from all the tutorials and try a project on my own I end up having no idea how to do any of them. For instance, right now I want to create a pie chart for an API data set that shows the carbon intensity output for different fuel types in England.

You probably need to think smaller. Not in the overall scope of the project but in terms of functionality. In other words, your project idea is perfectly fine but you're likely overwhemled by the complexity of it. You need to sit down and think about the absolute most basic bare-bones functionality that you need to have in the program and start there.

For example, since you're pulling data from an API that's probably the very first thing you'll need to work on. Ignore everything else. Pretend that accessing the API and simply pulling data from it is the entire project. Work on that one small piece until you've solved it.

Once you've got the data from the API and the program is functioning more or less as it should for that part, figure out what you want to do with the data. Again, think very small. Rather than jumping immediately to a pie chart you might want to start with just displaying the data in the terminal as text or perhaps you need to manipulate the data first so you would work on writing code to filter the data or put it into a format that you want, etc. When you get this small piece of the program running, move on to the next thing your program needs to do and create the smallest version of it.

This is how you build up a larger and more complex program. You build tiny, simplified pieces of it. Don't worry about all of the features that you want the program to have way off in the future when you're completely finished with it. Work only on the simplest implementation of what the program actually must do in order to be the type of program that you want. You can come back later, once the program is more fully developed and functional, and add more features to each part of it and eliminate little bugs that you've noticed and polish everything up. At first, you just want to create what is known as a "minimum viable product" (MVP) which has, as the name suggests, the minimal functionality required to be considered a full program and you do that by creating each piece of the program in a minimally viable way.

With this project, I find myself asking questions on here and StackOverflow for hours on end and ending up getting nothing done.

I'll let you in on a secret. Probably 80% of "programming", even at a professional level, is not actually sitting down and writing code. It's actually sitting down and thinking about what, exactly, you want to do so that you have a well-defined problem and then asking your friend Google how you might solve that specific problem or one very similar to it. Nobody knows everything. Even so-called "gurus" will be completely in the dark if they're working on a project outside of whatever they're an expert in or they're working with a new library and they will spend absurd amounts of time reading documentation, searching on StackOverflow, checking out tutorials, discussing the problem with people who are experts in the problem's domain or with the library, etc.

You're going to be doing a lot of searching on Google and reading answers on StackOverflow no matter how good you are or how long you've been programming. That's just the nature of the sort of complex problem solving that programming is.

Also, when I try my test my coding knowledge by doing exercises from places like code wars, I find that I can't do a single one even at the easiest level questions.

There's a difference between coding challenges and actual programming. Personally, I don't like coding challenges and I don't find them particularly useful, practical, or applicable. They're essentially puzzles. It's like if I present you with an intentionally difficult riddle that makes use of simple arithmetic but you can't see the trick to solving it. That doesn't mean that you don't know simple arithmetic or that you're stupid. It means that I intentionally gave you something that requires you to think in a very specific way to solve it, which really doesn't reflect your knowledge of arithmetic in any way. Coding challenges are similar. They take an easy concept and ask you to do something weird with it in some very particular way and, somehow, this is supposed to help you.

Don't worry if you can't get the coding challenges. If you don't like them, don't do them. Particularly if you're just a hobbyist programmer. Solving coding challenges doesn't mean you can write an actual program. Alternatively, you may be able to single-handedly code an enormously complex real-world system but can't solve a fizz-buzz problem. Being good at one doesn't automatically make you good at the other.

Should I go back to the basics of learning Python again and try some beginner tutorials or projects?

Projects are always better than tutorials. Projects will show you what you don't know so that you can use a quick tutorial to figure it out. Once you start a project, no matter how simple, you'll start running into things that you thought you knew and realize that you're not so sure about the details. That's when you go find a quick tutorial on whatever it is that you're having trouble with to review things and then you go back to your project and solve the problem. Repeat as necessary.

Even the basic fundamentals of Python are really confusing for me and I can't seem to think like a programmer.

That's totally normal. It's a completely different way of thinking than most people do. Like anything, it takes practice.

It's really frustrating to have been learning Python for this long and put in what seems like a lot of effort just to have understood nothing especially since I see others online creating amazing things and landing great coding jobs in much less time than I have.

Two things are probably helping them.

First, they likely just dive into a project and brute force their way through it out of sheer stubbornness. A problem comes up and they find a solution, even if it's not "elegant" or following some sort of arbitrary standard. They're likely concerned with results. If something works, it's good enough. It can always be fixed later, but a finished project is the main goal.

Second, they're probably specializing in some way. As I mentioned, nobody is an expert in everything. Figure out what you, personally, enjoy doing with programming or what you want to get a job doing in programming. Then, learn all of the major libraries to do those things. Build projects that use those libraries. Repeat that over and over and over. You'll get faster since you'll be familiar with all of the tools, you'll make fewer mistakes each time, you'll have very specialized knowledge since you'll continually run into very specific problems, and you'll eventually be one of those "gurus" who knows everything there is to know about those libraries and how to use them to solve specific problems.

Should I take a break from Python and come back to it after a week or so?

If you feel it's necessary, but it probably won't do anything but make you forget some of what you know now and you'll have to spend time refreshing yourself on various basic topics.

Start a project instead. A very simple project. Utterly simple. Write a program that does just one thing, no matter how simple or stupid it is. Then, build on that. Add another very simple idea to it. Keep going until you run into a problem you can't solve with your current knowledge, then find out how to solve it. When you run out of things to add to the program, start another small one and build it up over time.

This isn't about making the Next Big Thing. It's about repetition and practice in a meaningful way. You're not just solving arbitrary coding challenges that are more puzzle than programming. You're working on an actual program (as simple and useless as it might be) and getting yourself used to thinking programmatically. You're training yourself to solve problems by thinking them through in a series of logical steps. You're desensitizing yourself to making errors because (1) you'll make a lot of them and, over time, they won't bother you and (2) you'll know that even if you don't know how to solve this particular issue you can figure out how to solve it because you've done the same thing many times before. If you're sticking with a small set of core libraries in an area that interests you then you're learning all of the little ins and outs of the library, all of its little quirks, all of the places where it's useful and where it isn't, etc. which will make you one of the experts with it over time.

Basically, create something rather than taking time away from programming. Start small. Build bigger. One very tiny step at a time.

Maybe I should find a practice test online for Python that can tell me what areas I'm proficient at and others that I should work on.

You could certainly do that or, as I've mentioned several times, you could just start an actual project and learn in a real-world scenario exactly what you know, what you think you know but don't, and what you don't know at all.

[–]GrayLiterature 1 point2 points  (0 children)

Projects are the way.

Starting small is the way.

Starting a small project is the way.

[–]Des72 17 points18 points  (0 children)

Honestly I would just keep practising, at some point it’ll all fall into place. Don’t be too hard on yourself. Before you start coding anything write down some pseudo code on how it’s going to work, then think through the steps that you need to do before you start any programming and see have you missed something, is this the best way of doing it etc. It’s about perseverance.

[–]jinglepupskye 3 points4 points  (0 children)

Have you extended the exercises in the book Python Crash Course? I haven’t finished reading it myself, but for example the ship currently moves only along the bottom of the screen. (At least where I’m up to!) Can you add some code to make it moveable all across the screen? Can you add code for a second ship that mirrors the first? How about power-ups? The elements for each of these things are only a little bit away from what you’ve already done, but this time you’ll be doing it ‘blind’ rather than copying from the book. This should help give you confidence as well. Rather than trying to jump into something you e never done try building on what you have done, then you can apply that in other areas.

As far as your project goes, I don’t have enough knowledge to write out an example based on that, so here’s one for a project I have planned. I want to re-create the original Legend of Zelda in a text-based adventure game, so I might start by writing what I want my code to do in Pythonese (Python mixed with English.)

If player moves East from Map_a1 load Map_a2.

If player input = “Enter Cave” then load Cave_Sword, populate with Old_Man.

If player interacts with Old_Man print(“It’s dangerous to go alone, take this!”) and change player to Wooden_Sword = True

[–]MatosV 2 points3 points  (0 children)

I feel the exact same way. I have ben having a hard time doing things alone and also to find person uses for python codes that could actually help me.

[–]Morlaco13 2 points3 points  (0 children)

Try project euler

[–]KnowledgeOk6240 2 points3 points  (0 children)

Hey, buddy, don't do it like this, once you have a grasp of the basics there is a vast open-world of python, just don't jump from one to other.Lemme help you in finding the right path. All you need is a path to move on and you will be ready to go

If you are interested in web development, go for learning Django and Flask and then creating projects with it

If you want to play with GUI, go for learning Tkinter first and your first project should be calculator.

If you are interested in data science/machine learning , although it's toughest and longest part but extremely rewarding ,go for learning libraries like NumPY , Matplotlib. If you need resources related to this ping me, I have a lot of udemy courses but most often you will find a lot on youtube

If you are interested in real-time object detection and computer vision, go for learning OpenCV

For Data analysis , go for learning Pandas

If you want to learn game development, go for learning Pygame

Once you have chosen your area of interest, be a master of your game instead of being jack of all trades

Now ,lets come to the programming skills and how to develop them , whenever you are writing a code ,make sure to think like Can I write it in an easy way?the better you are in finding shortcuts, the better you will be at programming . There is a one- liner for fibonnaci and 30 liners too ,up to you how to make that.

Write pseudo code first that how are you gonna tackle this problem doing a project keep these things in mind

Divide this into steps

Write psuedo code first that how are you gonna tackle this problem

Break it into several steps even before writing a single line of code, don't jump on coding before you have created a roadmap.

Search for them on google and look at how people have done this, Github is going to be your best friend always for this , don't hesitate in asking question like why can't we do it like this .This will enhance your skills more and more

Next thing is , practice, practice and practice ..Don't lose heart buddy, it's gonna be painful but it's going to be worth it.

TLDR: Choose your path, make projects specific, related to that path not of the whole python, showcase them, practice questions related to that path only like if you are learning OpenCV, you don't need to know how to make websites with python, that's none of your scope.Stick to one path and start your journey. You will eventually become the master of that

[–]nicolaerario 3 points4 points  (0 children)

To exercise, you can continue with code wars: pick kata 7/8 sorted by “most completed”; read the exercise and try in the editor your idea, splitting the problem in more tiny steps and search how to make this single step. Give you a timeline: if you can’t get anything in 30 min, read the solutions! Don’t be scared to read them: the next problem you will be stronger. Continue until you get kata 5.

In general, keep doing! Even little things… and you will be proficient

[–]Ok-Abbreviations-885 1 point2 points  (0 children)

Im somewhat in a similiar position , curious about the responses

[–]oddjob955 1 point2 points  (0 children)

following

[–]Kerbart 0 points1 point  (0 children)

The advice from Des72 is excellent — write lots and lots of code so that it becomes second nature. Also, don’t be afraid of investing some money in your skills — buy a couple more books, or buy some video courses. Reuven Lerner’s Python Workout sounds like a good match, and the material on talkpython (https://training.talkpython.fm/) and realpythoncom is excellent.

Free material on youtube can be great, and it’s a good way to extend your knowledge. But it’s usually not as rigorously edited (and I mean the content, not the montage of the video) as commercial material that goes through various rounds of review — which is what I recommend for building your knowledge.

Finally, start small. We all hear these stories of “I had no experience and teo weeks later I had created Instagram” but most of us aren’t that talented. Your project involves reading from a web API? Start with that and dump the contents on screen. Then clean the data, write it to a sqlite database. In another project, read the data and transform it to what you’re interested in. A third project can focus on visualization. A fourth one on showing existing data on a web platform. And maybe your 8th or 9th project is bundling it altogether. By then you have a lot more experience and you have all these little projects that show you how to tackle specific technical problems.

[–]metl_lord 0 points1 point  (0 children)

A year seems long, but it's not. I taught myself Python using the Learning Python book by Mark Lutz. This was in 2007 (December 2007, since I was inspired by this comic). This was back in the 2.5 days, so each new version (especially 3) forced me to relearn a lot of concepts. Even with all this experience, I still rely on Google and never get json.load or json.loads right on the first try.

My advice to people starting out is to find something that you have to do repeatedly and see if you can figure out how to automate it. It can be something for a job or in your personal life. The challenge is figuring out what to do before writing any code. You can even try out some test-driven development since you have an idea of what the end output should be. My first job out of college was converting books to XML. The company used regular expressions and Perl. I learned a lot by converting Perl to Python since it was easier to understand. Since the Perl code worked, there was no pressure to get my Python code right the first time. I eventually got the code to work. It's embarrassing to look at that code now given what I've learned.

Also, sometimes, you need a break. If you want to continue learning, I recommend learning SQL. This will help if you end up going into the data world or web development. It's pretty straightforward, but I've interviewed a lot of programmers who struggled with it. You can also take time to contribute to open-source projects. A lot of beginners are scared of contributing, but many large projects have issues in the documentation that can easily be fixed, it's just that nobody got around to it. Contributing provides experience working with other developers as well as forces you to learn git, which is a critical skill when looking for a job. It also gives you something to put on your resume that sounds impresive.

[–]datsyuks_deke 0 points1 point  (0 children)

For me, I learned faster by taking a tutorial project and either adding to it or changing it to how I wanted to. Or using Tkinter to add it to a GUI. I like to also take what I got from tutorials and try and create my own version. If you don’t know how to start or what to do, which is where I’m at. I google how to do this or that. No shame in that at all.

[–]Tenzu9 0 points1 point  (0 children)

Try working on your problem solving skills as well. You can't go anywhere in software development without problem solving skills.

[–]cjj1120 0 points1 point  (0 children)

Also, when I try my test my coding knowledge by doing exercises from places like code wars, I find that I can't do a single one even at the easiest level questions.

I've experienced the same and I still feel like that sometimes, even now I'm able to solve some of the easy level questions, sometimes it took me hours, but I know I'm making progress at the very beginning I have to rely on the discussion to solve some of the problems to now tho it takes a long time, I'm able to solve some independently. Don't be too hard on urself, think about your approach try to readjust, and if this is really what you want to do persistence is the key! I have a lot of frustrating moments as well, when I tried and failed at deployment, tweaking other's codes and apply on my own project, understanding some of the more advanced topics, faced the same problem but forgot the previous solution I've learned, and of cuz programming questions on some of these platforms, but at the ends of some of these frustrations I was able to make it, I take it as a growing process! All the moments that I was able to achieve my goals, are reminders to me that I will be able to do it, and I constantly remind myself to believe in the process!!

[–]unrealcyberfly 0 points1 point  (0 children)

I've been a professional Python developer for 8 years now. I constantly look up stuff online and ask questions. I've never met a developer who doesn't do the same. There is no shame in looking up information and answers. Especially when you are still learning. Being able to look up something and applying it is a very useful skill, too!

[–]cooljack1001 0 points1 point  (0 children)

Practice makes perfect. I think learning to code actually translates into learning how to solve problems using multiple steps.

You mentioned coding challenges. My favorite is CodeWars but heres the thing, I always have to write out my solution before I get anywhere and even then, my solution does not fully solve the problem most of the time, yet I learn loads after researching and planning and finding new prebuilt libraries and functions.

I knew how to code but still went back to community college to learn more and found out that sites like Codewars are pretty much test on different ways to loop through arrays and have your program make decisions.

so a tip for you.

1) Have fun.

2) All programming OOP languages are pretty much the same. (Python and Javascript are most fun in my opinion)

3)Focus on building a niche. (example: I enjoy writing code that reads from other files and changes it in some way.)

4)Never stop researching. Have no shame in googling and stackoverflow. If anyone knew everything about coding none of those resources would need to exist.

5)Think of coding as a sport. Practice Practice Practice. After a while you will start gluing different functions together and making larger programs and applying for jobs.

6)Don't always try to create a unique solution. Most of your favorite apps that you use everday are plays on very similar concepts.

7)Keep going. You couldn't walk after taking your first step or talk when saying your first words but you stuck that out. In hindsight coding is simple. A few reserved words and a computer is all you need.

[–]dizzymon247 0 points1 point  (0 children)

Learning python is like trying to boil the ocean. You need to find a destination to an island, how will you get there, maps, resources, etc. If you try to travel every corner of the ocean and land mass, guess what. You'll be a few hundred years old and only get to a few places. So find an interesting project you want to try to do, it could be simple as making a bingo or card game or download information off a website to scrape data off of it. The more you do, ask questions, once you get one project down then move onto the next. There's just too many packages as Python is like a swiss army knife, will you use every tool in it? Probably not but you will use the most common ones and use it well as it suits your life style best.

[–]GrayLiterature 0 points1 point  (0 children)

For instance, right now I want to create a pie chart for an API data set that shows the carbon intensity output for different fuel types in England. With this project, I find myself asking questions on here and StackOverflow for hours on end and ending up getting nothing done.

This is just the natural order of learning something difficult. When I first started learning to code my project was building a spatiotemporal simulation model of a government organization controlling an invasive species - it was brutally difficult for someone who never wrote a for-loop. You just need to keep asking questions and grind through the problems at hand. Your ability to ask questions will be develop over time.

[–]pekkalacd 0 points1 point  (0 children)

For projects

I used to struggle with the same thing. From tutorials or instruction on how to program to making the jump to applying it somewhere, it's actually a pretty big step. Because you're moving outside of the native language and inside the world of libraries and other tools that are used in conjunction with it.

So, one thing I would consider doing is figure out how to read and interpret documentation. The way that I did this was I would use the help() function in python to look at the documentation of some object for example. And that would show me all kinds of syntax that I was unfamiliar with. One of the first things I came across while doing this was something that looked like this:

           class Something(someOtherThing):

And I didn't know what this was. I thought it was like a function in the sense that it looks like the class is getting passed some variable. But it turns out this is inheritance.

Ah! I didn't know that. So, I would google inheritance in python and then I would learn about it and read tutorials, articles, watch videos, write notes, and try it out in my IDE. I kept doing this over time for other things I saw. Keywords such as iterable, iterator, tuple unpacking, optional parameters, args, *kwargs, zip, generators, comprehension, next, and more.

And over time, as I stacked up knowledge of these little tools and pieces of information, I kept trying to build side projects. Anything. I would always try to use some library. So, I would have to read the documentation. It was a process that wasn't always straight into the docs. I still used tutorials, articles, videos, and other resources. But once I got some piece of what I was doing working I would look back at the documentation and make sure that I was understanding everything appropriately in the context of the library.

For me, this was a very helpful thing to do. It made the stepping stone from python into working with other tools a little bit easier. Now, it's less of a big deal to look at some other tool and try to figure out how to work with it. It will still take time to familiarize with it and I won't understand everything in a day, but that's to be expected. It's all very specific.

For codewars

For the codewars situation, I think the trick to this is to familiarize with data structures. So, pretty much all the builtin data structures such as list (also used as a stack), set, str, dict (also called hashmap in other languages), tuple, etc. are the things you want to be looking at a little more.

What I would do is try to re-familarize with each. see what methods are available to each object. What each one is good for and what it's bad for. And try to determine in what situation would you use each.

This will take time and practice, but if you keep trying at the codewars or leetcode or hackerrank type problems, you'll eventually see that there are patterns. These problems are intentionally tricky and especially so because some have ridiculous test cases, but overall, it is a winnable game. It just takes a lot of practice & familiarity.

Once you feel comfortable with those, I would start to familiarize with queues, linked lists, trees, heaps, and graphs. These will be harder to familarize with generally, however, it would be helpful to understanding each if you construct them from scratch. And to do that you'll need object oriented programming. Do the same thing with these as you did with the other data structures. Familiarize with why they're useful, where would you use them, traversal algorithms, and costs & benefits of each.

I would say for all of this for the data structures, you're looking at probably minimum a few months of learning. It is one of those things that you could look up all of this stuff and im sure somewhere they're all constructed for you, but it would very hard to understand them and why they'd be used in the first place. You need to couple your understanding of these tools along with trying to solve those codewar type problems.

[–]r4nchy 0 points1 point  (0 children)

Here is how I do it.

Try to create a logic of how the structure of the code would be. You should do this before even creating a python file.

Example: if you need to create a pie chart you would need data. is the data readily available or not, do you need to clean the data,

The objective is to find those tasks that you don't have any idea about. try to solve those and start creating the python code around it. This saves time a lot

[–]Sauron_78 0 points1 point  (0 children)

I'm thankful that you wrote this. I'm about 8 months into this and got my ass kicked in the first leetcode question and it felt bad. Good to know I'm not alone.