r/programminghelp • • Aug 14 '26

Python Help with code

6 Upvotes

I keep getting this error:

for this code:

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

bestmass = []

for mass in df_sorted:

if best_ms == (array[array > 7.5]).all():

bestmass.append(best_ms)

print(bestmass)

and i don't know what I am doing wrong

r/programminghelp • • Jun 20 '25

Python Is it ok to use AI when learning how to code?

18 Upvotes

Whenever I’m coding and I can’t figure out how to do a certain task in Python, I always go to AI and ask it things like “how can I do this certain thing in Python” or when my code doesn’t work and can’t figure out why I ask AI what’s wrong with the code.

I make sure to understand the code it gives back to me before implementing it in my program/fixing my program, but I still feel as if it’s a bad habit.

r/programminghelp • • Sep 26 '26

Python Need Help Installing REBOUND through Python

2 Upvotes

Latey I've been trying to install REBOUND through python, I have Windows 11 and when I try to look at turtorials, steps, etc. I just get confused and hit a brick wall. I am in high school, wanting to be an astrophysicist, and installing REBOUND will help me with that. But, I have no idea how to install it without direct human guidance and not just looking a videos and text. I need help from someone who installed REBOUND to help me install REBOUND.

r/programminghelp • • Jul 24 '26

Python import manim could not be resolved

3 Upvotes

so i downloaded manim locally which is a python library in my linux pc just like the way the manim documents thing said to, i even checked using the terminal that manim is there, but whenever i type on vs code "from manim import *" it says "import manim could not be resolved"

idk what to do now

r/programminghelp • • Jul 10 '26

Python Is there anyone who can help me read pkl file.

0 Upvotes

I Know it is a simple task but I get some version related error.

I have done web search (both gemini and SO and so on). I even understood the proposed solutions but it seems like pkl files were created with an unknown version or at least not the one that is installed in my machine. That's why it gives error

"An error occurred while loading the file: CRS.__init__() missing 1 required positional argument: 'proj4_params'"

anyone who can give me 5 min to sort it out.

r/programminghelp • • Feb 10 '26

Python Python won't let me indent after my indent statement

1 Upvotes

I am following automate the boring stuff and am in chapter 2. It is talking about blocks of code. The first code example is

username = 'Mary'

password = 'swordfish'

if username == 'Mary':

And then the next line is supposed to be indented, and say

   print(`Hello, Mary')

The problem is after I hit enter after the if statement, I get three dots (...) and it will not let me indent when I press tab. And if I try to put the code in anyways it says

IndentationError: expected an indented block

I am using Mu and can't figure out why I am not able to indent. The tab key does nothing. Even on a brand new line of code the tab button doesn't do anything.

r/programminghelp • • Jun 23 '26

Python How to make python search for a specfic file types in a folde in windows?

3 Upvotes

i just wanna make it change metadata to the image when it find it it could be easy, but is there any modules for exiftool or metadata things?