Questions Tagged [Python]

Python is a multi-paradigm, dynamically typed, multi-purpose programming language. It is designed to be quick to learn, understand, and use, and enforces a clean and uniform syntax. Please note that Python 2 is officially out of support as of 2020-01-01. For version-specific Python questions, add the [python-2.7] or [python-3.x] tag. When using a Python variant (e.g. Jython, PyPy) or library (e.g. Pandas, NumPy), please include it in the tags.

1,970,212 questions
-1 votes
0 answers
8 views

Can I get other program start time somehow? [Python]

I want to track running time of other program (eg discord). Is that even possible? Other programs I found track time of program was used, but not it in the background.
0 votes
0 answers
4 views

How can I save each image?

This is my code, in which I am taking a masked image and cropping that masked image, and generating histograms of those crops. Now I want to save my crops and check if they contain non-zero pixels or ...
-1 votes
0 answers
5 views

How can I Fix This Error in Face Recognition Project

When I Run the Code it gives me this error : Traceback (most recent call last): File "C:\Users\PycharmProjects\FaceRecognitionProject\AttendanceProject.py", line 48, in imgS = cv2.resize(...
0 votes
0 answers
14 views

How do I pop the last elements of lists nested in a dataframe?

I am manipulating the following dataframe: CaseID Activities 0 0 [10, 16, 577, 250] 1 1 [355, 10, 16, 577, 578] 2 2 [355, 578, 578, 16, 578] 3 ...
0 votes
0 answers
9 views

How can i move the character up and down? [duplicate]

enter image description here from sys import exit pygame.init() screen = pygame.display.set_mode((500,500)) name = pygame.display.set_caption('witchie') icon = pygame.image.load('C:\\Users\\lenovo\\...
0 votes
0 answers
11 views

Multiply by a different number of columns with iloc in Pandas

I have the following dataframe: df = pd.DataFrame({'date' : ['2020-6','2020-07','2020-8'], 'd3_real':[1.2,1.3,0.8], 'd7_real' : [1.5,1.8,1.2], 'd14_real':[1.9,2.1,1.5],'d30_real' : [2.1, 2.2, 1.8], ...
0 votes
0 answers
4 views

How do I correctly implement contours of histograms with logscale binning in numpy/matplotlib

I am trying to plot contours of data that his been binned using numpy.hist2d, except the bins are set using numpy.logscale (equal binning in log space). Unfortunately, this results in a strange ...
-1 votes
0 answers
9 views

doing a linear search python code for a list and for some reason im getting both conditions satisfied, can someone help me with this

K=[30,15,25,50,40,35,44,49,55,54] Search = int(input("enter the value you want to search")) Index=0 Found=False while Index<=9 and Found==False: if K[Index]==Search: print(&...
0 votes
0 answers
12 views

Have 2 large, different size columns in dataframe I am trying to group all values that match each other and give them a Unique group ID in new column

I have a dataframe that has 2 columns, the first column has around 60000 pieces of data the column on the right has around a thousand and I went ahead and changed all Nan values to just say none, not ...
0 votes
0 answers
5 views

cross_val_score and LassoCV.score() produce different r2 scores

I thought those two methods should produce similar scores but then I got different scores. Here are my codes: #prepare the data and model X_train,X_test,Y_train,Y_test = train_test_split(X,Y,...
-1 votes
0 answers
8 views

MongoDB and Python :: Why is $group throwing a syntax error?

I'm a complete beginner to MongoDB and have what I hope is a simple question about how to use the $group command in a MongoDB/python script: Suppose I have a MongoDB instance, loaded with 1000s of ...
  • 1,157
-1 votes
1 answer
19 views

Can we convert python code into machine code that hardware could directly understand? [duplicate]

Can we convert python code into machine code that hardware could directly understand without needing to install python to run it?
-1 votes
0 answers
9 views

Extracting a list of objects that contain n number of subobject

I'm working with labeled images, I got a list of objects "Annotation" and "Image" class Annotation: def __init__(self): self.name = ... self.bbox = ... ......
0 votes
0 answers
6 views

How to crop images / edges in a picture in OpenCV

Here's a picture of a maze solver, when the BFS function goes over the image it goes around the image I know it's possible to just crop the image manually, but I want a function where the computer can ...
0 votes
0 answers
5 views

Kivy: Index of the child Button that was pressed

In this very simple code here, how do I find which Button is pressed? In particular I want the index of the pressed Button, not the name nor the text of that Button. Python: from kivymd.app import ...

15 30 50 per page
1
2 3 4 5
…
131348
Chloe Bennett

Chloe Bennett

Culture, Media & Entertainment Columnist

Chloe Bennett explores the intersection of pop culture, streaming entertainment, digital trends, and contemporary lifestyle. Her weekly commentary reaches thousands of culture enthusiasts.

Share this article
Twitter Facebook Pinterest