Category "python"

Pyinstaller can't find a module? (error loading Python DLL)

I compiled my program with pyinstaller, and it works fine on my computer, but whenever I ty to run it in another computer (with no python), I get the following

Can't seem to replace current sprites with image [duplicate]

I'm trying to replace the sprites with an image (in this case a race car), but the sprites aren't changing. They're remaining rectangles and a

ValueError: X has 19 features, but LinearRegression is expecting 20 features as input

I'm trying to do polynomial regression using this code here: x_train,x_test,y_train,y_test = train_test_split(self.X, self.y, test_size=split, random_state=rand

Why does numpy.angle(0+0j) answer pi instead of zero

I am creating an array of complex numbers and compute the angle. When I set the magnitude to zero, I expect the angle to always be zero. However, I get pi if th

Matplotlib plots in the wrong data format eventhough it is a datetime object [duplicate]

I have a problem when trying to plot a timeseries with matplotlib: df = pd.read_csv('myfile.dat', skiprows=1) #Change data type to datetime d

Batch conversion of xlsx files to txt in Python

I am trying to convert files with the extension xlxs to txt files. All items have the same name and are marked with a number. The problem is that there are no n

Fixing memory leak in tensorflow2 during loading the model

I am new to tensorflow-2 and I am experiencing a memory leak in my object detection application. I was able to track the section which causes the issue. class T

Dataframe with scipy minimize function

Im trying to minimize sum square function that works with a dataframe. The df is as follows: ds = pd.DataFrame({'t': [*np.linspace(0,300,7)], 'Ca': [0.05, 0.038

Making a Naruto Game in Python

i have been stuck in this problem for a while now, am trying to make a game where the user is given only 100 number to create a well defined shinobi ( got the n

Pip install from archive

I am trying to install Dtale in jupyter notebook. Due to the firewall restrictions, I cannot install it online. I tried to download the archive file dtale-2.2.0

How to deal with SettingWithCopyWarning in Pandas

Background I just upgraded my Pandas from 0.11 to 0.13.0rc1. Now, the application is popping out many new warnings. One of them like this: E:\FinReporter\FM_EXT

I want to remove the first ( ) and it´s unkown content every time i loop

I tried the next code but it did not work: info = ["Mark(Sat)", "James(Sun)", "Robert(Sun)", "John(Fri)"] for x in info: info.remove(info[info.find("("):i

Best way to manage Terraform apply infra -AWS batch- run a script (could take 1hr to 1day) - destroy infra

Hi All I am planning to build a system for my team where we can start a AWS batch infra - run a task - once job done destroy the infra. I am thinking of : Make

Mypy marks error when using TypeVar type inside TypeDict derived class

I have the following code: WriterMeta = typing.TypeVar('WriterMeta', GSheetWritable, S3Writable, LocalWritable) class WriterDesc(typing.TypedDict): name:

pyenv global x.x.x does not update the python version on linux

I have pyenv installed and have downloaded python versions 3.6.15 and 3.7.12. When I run pyenv global 3.7.12 python -V the output is: Python 3.10.2 pyenv versi

HTTP Error 401 unauthorized when using python requests package with user-agent header

I am trying to reverse engineer a web app. So far, using the inspect tool on my browser, I have managed to log in the website using python and use multiple part

Can't load a transformer model from huggingface

I was trying to load a transformers model from huggingface to my local jupyter notebook and here's the code from transformers import AutoTokenizer tokenizer = A

pandas.core.indexing.IndexingError: Too many indexers in scikit-learn agglomerative clustering

I have this data set: col_index Sample FID SNP1 SNP2 SNP3 SNP4 SNP5 LiverCysts ESRD_Aug2020 Renal_Survival_Aug2020 Group 1 23 0 1

Python Discord Bot Commands Decorator within classes

Hey I was coding a discord bot, however I can't figure out how to write the commands decorator, I think that's because I am putting all the code in a class, wit

My Tkinter Python code returns "I/O operation error"

I am trying to create a code that will detect cursor coordinates upon user's entry and exit of the Tkinter window. However, I am not getting an output the first