Category "python"

i can't change screen kivy

how can i change screen when i click to any button in my main screen for example in may program (bad 01: imene, bad 02: kamel, ...) to screen name "value_secree

Error installing python 3.7.6 using pyenv on new macbook pro M1 in OS 12.3+

I am struggling to install python version 3.7.6 using pyenv on my new macbook pro M1 running on mac os 12.3.1. My configuration $ clang -v Apple clang version 1

program to Read content from 1 file and write string which is started from specific word and end with specific word into another file in python

Write a program to Read content from one file and write a string which is started from a specific word and ends with a different specific word into another file

Passing information between while True statments in python

''' I am trying to figure out how to pass information between two while True statements. Basically when player1 asks for a card, I want to store that card in a

Calculate MAPE and apply to PySpark grouped Dataframe [@pandas_udf]

Goal: Calculate mean_absolute_percentage_error (MAPE) for each unique ID. y - real value yhat - predicted value Sample PySpark Dataframe: join_df +----------+--

Error using Tk inter, when creating an event

So I have an assessment where I have to create a pygame using Tkinter, the objective is that you drive a Car and you have to dodge other cars that pass by, the

How to connect signals and slots over different class-instances

I have custom listviews with corresponding custom models. I use QML for the frontend and load the main file with Python and use python for the backend. The mode

How can I make a function called build() have one string input and it returns a dictionary?

I have a project that requires me to make a function that takes a string input and return a dictionary. The string will be consist of a name and a phone number,

BeautifulSoup library Parsing very slow for Amazon Scraped pages (using both html.parser and lxml)

I have been scraping using BeautifulSoup library in Python for scraping Amazon.com. I am successful in that using proxy rotation, but the problem is that the pa

Why does my code keep running even after it reaches the end?

I am having some troubles with my program as when it reaches the end of the third() function, it continues to try to execute transactions. I tried having it ret

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