Category "python"

Whenever I try to run my script it stops working

I am currently making a py game and python stops working every time, but I'm not sure why. from turtle import Turtle, Screen screen = Screen() screen.setup(600

Tensorflow data pipeline stops working during training

I made a Tensorflow pipeline for loading numpy arrays (video data shape (40,160,160,3)). However, it stops working after loading the first x batches. The proble

how to dynamically set the number of variables in SciPy's optimize.minimize

I have this code work fine to optimize multiple variables. def f(params): a, b, c = params return a**2 + b**2 + c**2 initial_guess = [1, 1, 1] result

Can't install arcpy in Jupyter Notebook

I have ArcGIS Pro installed, which includes the installed Python packages. I am trying to learn Python and would like to use the ArcPy functions. I have never u

How to show .csv data file in a more visualized .html file?

Below is is my output .csv file. Is there a way to show the output in .html template file using python to show it in more visualized way? Date,Text 2021-09-03,"

How to run aiosmtpd via Docker

My Dockerfile FROM python:3.10-alpine LABEL Description="test smtp server" EXPOSE 8025 COPY ./requirements.txt /app/requirements.txt WORKDIR /app RUN python -m

OPTICS algorithm with different epsilons on different axes

I am trying to cluster the supplied charging power to different vehicles. import numpy as np import matplotlib.pyplot as plt from sklearn.cluster import DBSCAN

pyscript print function displays then vanishes in a second

I recently started using pyscript and in the tag I have only written a print statement. On the browser the value prints but only for a second and then vanishes

Bayesian Optimization for hyperparameter tuning

I have a problem with this code. I need to optimize dropout rate and learning rate. My code is reported below but the optimizer = BayesianOptimization() doesn't

How to convert dataset train and test to images to classification in cnn?

How I can convert dataset train and test (type of files is excel shape(269855, 13)) to images to classification in cnn

How can I skip a piece of code in recursion?

def bin_to_decimal(inp, degree=0, result=0): arr = [] for i in inp: arr.append(i) if not arr: return result else: x = ar

calculationg the mean from each Dataframe column

I've to write a function (column_means), that calculates the mean of each column from Dataframe and give me a list of means at the end. I'm not allowed to use t

how to print time in python in customized format? [duplicate]

how can I print time in format using python 220429 first two letters are last two digits of 2022, midle one are month and last two are day in

Dataframe extracted from email, ValueError: Cannot index with multidimensional key

A dataframe extracted from email (email saved to local disk, ".msg"), that I am not able to read its content. The dataframe extracted from email, when wrote to

Data problem: identifying data rows where colleagues have reached a consensus

I have a table that shows the results of four colleagues trying to classify several objects as either a, b, c or d. If the colleagues were able to agree on the

find top performing list of category which have highest number of orders in django

models.py class Line_items(models.Model): id = models.AutoField(primary_key=True) product = models.ForeignKey('Products' , on_delete=models.DO_NOTHING ) cl

Chaining Pandas DataFrame Styles

*edited DataFrame random generator I have 2 dfs, one used as a mask for the other. rndm = pd.DataFrame(np.random.randint(0,15,size=(100, 4)), columns=list('ABCD

how to apply a format on multiple excel files at once (hide gridlines & autofit columns)

I'm trying to apply a specific format on an iterate excel files, i need to hide the gridlines and autofit columns width, i tried many codes and styles but no on

Python's tqdm progress bar in IDLE

I have problems using the Python tqdm progress bar with IDLE. Instead of displaying a dynamic progress bar, as it happens in Jupyter, IDLE prints new progress

CV2 cap.set(1,idx); cap.read(), Does it Read Frame idx or Frame idx+1

In CV2 will this chunk of code read the frame for the given frame number or the next frame? desiredFrames = [3,5,7,n] cap = cv2.VideoCapture("somefile") for id