r/learnpython • u/New-Row-7664 • Nov 09 '23
CONFUSED LOSER
i am an electrical engineer.i am 39 and unemployed. i did a DATA SCIENCE course for seeking a job.
But i used to watch python related videos for two years. In the course they taught the basics of python, simply like theory but not practical stuff like OOPS, functions, classes etc.
the problem is whenever i study DATA SCIENCE concepts i forgot python and when i study python i forgot DATA SCIENCE concepts. This has been going for more than a year.
i have downloaded a ton of python books and online courses recommended in one of the threads suggested in this forum.
now i have been given a youtube data harvesting projects that include streamlit, mongodb and sql.
but i am not able know WHEN AND WHERE I should create and use functions to retrieve data from youtube. the advice given to me was that i should search the INTERNET FOR writing code for this project.
i can understand the theory part like to get an API key etc, but i am not able to implement it practically.
neither do i want to copy these codes from github(i have found out that many have done this project)
where i am going wrong i dont know. i am unable to grasp concepts when they have been taught to me once or twice. i dont know if i am having attention deficit disorder.
when i post these questions in forums the answer i get is, " practice MORE".
I HAVE TRIED various competitive programming sites like codechef, hackerrank etc. BUT THE MATH PART CONFUSES ME.
what should i do? to implement theory concepts in python to codes. i dont have a study plan.
where CAN I FIND ANSWERS TO THESE QUESTIONS?
10
Nov 09 '23 edited Nov 09 '23
Are you already confident in basic programming? So you can solve simple problems like fizzbuzz etc? I'm just curious because you're talking about databases, API keys and competitive programming, but also claim that you apparently don't know when to use functions.
If you don't have the basics down, don't bite off more than you can chew. It's sure to overwhelm you if you try to do all this stuff unprepared.
If you do, start small. You don't have to write an entire program at once, just a single function with a single job. E.g. a single function that asks the user for the API key. A function that uses the API key to make a call and saves the response. A single function that parses the response. A function that prints stuff. A function that writes stuff into the database etc. Whenever you decide to finally "write the program", all you have to do is put the functions together in order.
2
u/Electrical_Prior_905 Nov 09 '23
Maybe I'm misunderstanding OP, but I feel like he's unsure of when to use functions/classes etc. and how to structure them.
1
u/New-Row-7664 Nov 09 '23
yes you read me right.
suggest some resources with lots of examples where i can find answer to the above question
0
2
u/ElliotDG Nov 10 '23
I'm going to assume you understand the basics of programming. If this is an incorrect assumption, let me know:
Read the python tutorial on the Python.org: https://docs.python.org/3/tutorial/index.html This is a quick overview.
Read: "Learning Python", by Mark Lutz. It is a comprehensive book that covers the python programming language. I suggest getting the book, it is a good reference.
In addition, to get some practice and see how other code in python use https://checkio.org/. Checkio provides gamified programming problems. You solve a problem, you get to see how others solved the problem. I found this very helpful to learn what is "pythonic", and the importance of the built-in libraries.
Bookmark these references:
https://docs.python.org/3/library/index.html It covers the built-in functions, the basic data types and the standard libraries.
https://pymotw.com/3/ - Sets of examples using the standard libraries.
After you are comfortable with the basics and bored with checkio, start to work on a few self-defined projects that will exercises your data science and programming skills, perhaps linked with another interests. Are you sports fan? analyze sports scores, Stock market investor do some stock analysis. Is there an industry that you want to work in - build a small project that would be relevant or something to talk about in a job interview. Do not get too ambitious with these projects. Keep it simple to start.
If you hit roadblocks, post code here and ask for help.
Good Luck!
1
3
u/bronzewrath Nov 09 '23
Start with simple things you done in data science and make small apps with it. It doesn't need to be useful.
For example, you made a notebook that receives a CSV file, analyse some stuff and create some plots. Or take a image, do some processing and spit out a classification. Or take a url and download all images in a page. It can be anything you have done before.
Pick this bunch of code and create functions. Define as parameter anything that you may change like the path to the input file, the url, any configuration you may want to vary. Now your program is a bunch of functions and a small part at the end calling the functions.
Now take this bunch of functions, transform into a library and publish to pypi. Now you can install your library using pip install and import your script or notebook. Your main script is now just a import and the last piece of code calling your functions.
Now take your library and make a cli application. Instead of calling your functions from a script you will from your shell.
Now take your library and make a rest API, a server rendered website with Django or flask, a gui app with tkinter or pyside.
You can also make unit tests and get your library test coverage.
These all will probably suck the first time, you probably need to refactor your library a few times, but you will learn a lot of practical stuff doing this.
3
2
u/socal_nerdtastic Nov 09 '23
Funny I'm studying EE right now and feel like a complete loser; I cannot wrap my head around op amps at all. Like I get the theory but now that I have an actual use for one I cannot figure out how to set it up.
2
u/Doormatty I get paid to write Python! Nov 09 '23
I'm right with you there.
I can build a ALU from individual gates, but an op-amp completely baffles me.
1
u/unnamed_one1 Nov 09 '23
Building an application can be overwhelming and you'll likely not have all the knowledge you need to build it at once. So think of it like a puzzle or Legos and start drawing it on paper. Destruct all your components in simple parts, which do one thing, but one thing well, and then connect them with each other. Design patterns may help with certain problems, but are not strictly necessary. As for program structure, just start without it and later on, think about logical groups, reusable parts and start making modules. At least that's the recipe I'm trying to follow. Oh and videos or books are nice, but they can never give you the knowledge and understanding, that a personal pet project can.
*edit: typos and stuff
0
Nov 09 '23
[deleted]
0
Nov 10 '23
[deleted]
2
u/RealOneEyedJack Nov 10 '23
Not my intention to unnecessarily confuse the topic or deter.
There are profitable and short Time-to-Market projects...
If a school approached you and said can you develop a Math based tool for interactive learning...that is NOT a steep learning curve.
1 language & and a framework
an IDE
basic programming
Packages/Libraries/Modules already there
Content (just scrape, it's probably out there)
Input
Display
Google Classroom
Adsense or License
12
u/KingsmanVince Google YOUR questions and errors first Nov 09 '23
I notice that you have done lots of tutorial, have you done any project on your own?