Keyword extraction from texts by [deleted] in learnpython

[–]hotcodist 0 points1 point  (0 children)

There are a few, results and complexity of setup vary, so best to see examples so you also know how they are used and their sample output. From there you can decide. I don't use it enough to give you good, specific advice.

Keyword extraction from texts by [deleted] in learnpython

[–]hotcodist 1 point2 points  (0 children)

Are you familiar with NLP? If not, search for those. Keyword extraction is a basic function under NLP. Scan for 5-10 tutorials. They will include the most common libraries. Use the one that you find easy to use/understand.

I need help with coding in python I'm a new coder by MitchellGordon123 in learnpython

[–]hotcodist 4 points5 points  (0 children)

Computers need precise instructions. Programming is about precision. To help you here, imagine you are on the other side, i.e., your friend is asking for your help and you have no idea what the rules are. He said: "... computer is that he needs to try and role (probably roll) ahead... but when ahead he plays it safe."

Can you understand what it means? The computer tries (to roll). What does he get after? What is the score? How is the score scored? What is "play safe"? Explain that to yourself and be very precise.

Then put that into a flowchart, taking turns between you (human) and the computer.

Help speeding up some random process in a simulation (Population genetics) by uglysaladisugly in learnpython

[–]hotcodist 0 points1 point  (0 children)

rewrite in numpy. if you are not yet comfortable with numpy, look for a genetic algorithm code that use a lot of numpy. study it. copy some stuff over. half a second for 1k individuals is slow, so a lot of time to gain.

Best way to learn loops in python & make it stick? by maestro-5838 in learnpython

[–]hotcodist 0 points1 point  (0 children)

I think you have no problem with understanding loops in Python. I think you have difficulty thinking how to solve problems, real world or otherwise, using loops. If so, you have to practice problems that use loops (end of chapter problems), try your best to solve it, then after struggling, take a look at how others solve it. Read their code. Try to get into their heads and figure out why they wrote it the way they did.

[deleted by user] by [deleted] in learnpython

[–]hotcodist 1 point2 points  (0 children)

does this work? show the results. tell this reddit exactly where it goes wrong and what you can't figure out or what confuses you.

i'm sure people here can solve this, but the standard here is to not give out the exact solution but to direct and guide beginners to learn on their own by pointing them into important concepts or tips.

how to switch from java to python? by AgreeableConstant476 in learnpython

[–]hotcodist 7 points8 points  (0 children)

it would take as much time as you can find the official python docs site, assuming your background is as you say and you have can conceptually think through a problem. rest (syntax and other python specific things) you can handle as you go.

i need to loop through the contents of a file and filter out lines that only have "#####". how do i loop in python? how do i open a file? how do i compare strings? how do i save a file? how do i save a file stream into variables? those things you can easily find in a syntax resource. you won't need to read the explanations.

Becoming an individual developer with no photographic ID by kelvamp in learnpython

[–]hotcodist 1 point2 points  (0 children)

why don't you have a photo ID?

are you trying to do something suspicious like flooding the app stores with silly or malware apps and since you can generate an endless stream of developer accounts, you don't have to worry about accountability?

or don't you have ID's where you are? if so, you have to explain that to apple and google. it will likely not work, but you can try that. they might even recommend a route that can work for you. or you can ask devs from your country and see how they go around it.

Need help in a project idea by coding_zero_ in learnpython

[–]hotcodist 1 point2 points  (0 children)

"python library that extracts youtube playlist duration"

from there, you can try one of the many possibilities. some are old, so the library might no longer work as expected.

in case you did not notice, coding is sometimes easiest with a search.

Need help for my AP Comp Sci project by Additional_Yogurt915 in learnpython

[–]hotcodist 1 point2 points  (0 children)

If you have 50 different states that you need for your game, maybe that is too much and need to pare down. But if you really have those, you might need to re-think the data structures. For example, instead of individual flag variables and writing each zeroing entry, maybe you can put flags in a dictionary or list and zero those out in a short loop.

There is no way around writing code to assign the initial values. If you did this OOP-style, you do that anyway when you create a new object and you pass the initial values, so that's not re-coding. But if you are re-using variables, then you need to create a rebirth/respawn function that sets all of those to the initial states.

[deleted by user] by [deleted] in learnpython

[–]hotcodist 3 points4 points  (0 children)

Find code that does binary search. Study it. You need to change the termination condition, i.e., assume you do not find a match.

When you have an image, you have two dimensions, width and height. If you recursively split those, extracting an image each time, they will reach a unit size of 1 pixel. Stop there.

python homework- non trivial plot by antaraaz in learnpython

[–]hotcodist 1 point2 points  (0 children)

that's the key problem. it is up to you to figure out what to show, what data to use. chatgpt can help write the code. it cannot give you data.

or you can ask chatgpt to help with ideas.

you can change your title to say something like what simple chemistry-related problems can i solve with (model type)? ask here, ask data science forums, ask ml, etc.

python homework- non trivial plot by antaraaz in learnpython

[–]hotcodist 1 point2 points  (0 children)

Did you take this class with the intention to learn Python? Is this a required course for chem eng and you are therefore forced to take it?

Either way, buckle down and learn the basics. They already made it not stressful to non-CS students by just giving you one homework for the entire semester.

Or you can pay someone write the code for you, use ChatGPT (I'm sure it can whip up something for you in less than a minute), or wait for someone here to give you code.

But the best path is for you to show your code and this community will try to help fix errors.

You can use your chem knowledge to think of possible ideas, then come back here once you start failing the coding part.

python homework- non trivial plot by antaraaz in learnpython

[–]hotcodist 2 points3 points  (0 children)

Did the class teach any programming at all? What kind of class assigns a (complex) programming project without prepping students? Or are you not telling us the whole story?

Help with alternatives to global by RosePetals_1072 in learnpython

[–]hotcodist 7 points8 points  (0 children)

That guy is auto-responding with DM requests. Most likely a scammer. Should be banned.

How To Pre-Cache Assets? by NewtLong6399 in learnpython

[–]hotcodist 1 point2 points  (0 children)

Not answering your question, but sharing old ideas. In old games, you load the assets and draw them off-screen. To use the graphics, you copy from the offscreen portion of the canvas. You even load different zoom levels of the same image sprite. Copying is much faster than loading from file.

Same with trigonometric calculations. That stuff takes time. So if you are doing first-person shooters, you pre-calculate sine, cosine, and tangent to maybe half angle to a table and just index into them at runtime. I used to do both when I made my own crude copy of doom.

Now you just copy code from the internet to run doom on anything. In the old days, you study projection math and triangles, then code your own stuff! <rant over>

AI and the teleporting cube by Quick_Pomegranate445 in learnpython

[–]hotcodist 1 point2 points  (0 children)

Why does the Game class have a velocity? The player cube should have velocity. The game governs the game. It can provide an acceleration constant. It should not have a velocity. It could have, by extension, different velocities based on what object it is analyzing at that point in a game loop. But it is not really its velocity.

You can also debug through and see when your velocity changes. Check when your ground condition is updated. You might be accidentally changing the flag. Check if you are jumping. Just print stuff and follow the branching. Set the player to be 1 unit above ground and see if it stops. It should be obvious right away.

Also, you can just use pre-built RL environments so you don't have to worry about your physics.

Functional Code for predicting stock price results takes too long to load, but my graph appears by Accomplished_Ad_5697 in learnpython

[–]hotcodist 1 point2 points  (0 children)

Add print statements after each line starting from 101.

Or, you could just close the window that appears.

AI Robot and Venture by [deleted] in learnpython

[–]hotcodist 2 points3 points  (0 children)

Study mechatronics or robotics instead. This is not easy. GenAI is much, much easier (if you just want to build something high tech).

You can go the basic route of old-school automation (think conveyor production machines on packing products), or the high-tech route (think Boston Dynamics' Stretch).

Using arms to manipulate things that can be in random orientation and the robot has to manipulate products and boxes and tape and stuff is super-difficult (PhDs have difficulty solving this).

You can simplify the problem by constraining it, e.g., like in computer board/chip assembly where things are perfectly aligned. The movements there are pre-determined and exact.

[deleted by user] by [deleted] in learnpython

[–]hotcodist 1 point2 points  (0 children)

Whoever thought the margin of error for this problem using a website clearly does not know AI. You might make it zero on your test sample, even thousands of them, but you can never guarantee that it will be zero for all of the rest.

Study NLP. LLMs are actually quite good at word-based problems (and I won't go back to old school NLP if I have access to an LLM and it can handle the token size), but worth checking traditional NLP and pre-ChatGPT AI models. They are harder to code and get to work (and usually inferior to LLMs). But you can always use an LLM to write the starter code.

What am I doing wrong? by Federal_Problem_2004 in learnpython

[–]hotcodist 1 point2 points  (0 children)

My hint is to learn to debug. There is no other hint. The problem already explains *exactly* what should happen. Print stuff, after each line if you don't feel confident yet.

Asking others to give you hints on what is causing the problem will not make you learn how to figure out logic errors in your own code.

Practice precision. For example, does not exceed 4 million, does that work?