Questions tagged [python]
Python is a dynamically typed, multi-purpose programming language. It is designed to be quick to learn, understand, and use, and enforces a clean and uniform syntax. Note that Python 2 reached end-of-life on January 1st, 2020. For version-specific Python questions, add the version tag (e.g. [python-3.x] or [python-3.9]). When using a Python variant (e.g. Jython, PyPy) or library (e.g. Pandas, NumPy), please include it in the tags.
python
2,204,477
questions
1
vote
0
answers
6
views
How to filter Pandas Dataframe to integer values?
I have a dataframe column with string values. I want to filter to the rows that have integer. I can do the below to find if it's numeric, but this would return floats as well.
result = pd.to_numeric(...
-1
votes
0
answers
9
views
SSH, how do i know username and password? why arent my tunnels working?
So ssh is something new i discovered, i want to bypass a network guard i made for experience, i cant seem to understand how ssh -N -L localhost:8000:localhost:80 root@servername now. i understand the ...
0
votes
0
answers
9
views
In a dataframe,replace values from one column with multiple conditions and not in the same row to another column
I am trying to transfer values from one column to another column in a dataframe, with multiple conditions and not in the same row.
Values from Columns 'BEGUZ_H' and 'ENDUZ_H' to Columns 'BEGUZ' and '...
0
votes
0
answers
5
views
Optimization of cylinder rotation to overlap to 3D array
My 3D array of labels contains one label "109" roughly representing a cylinder. I can find the height, radius and center coordinates with skimage.measure. Next, I can draw another cylinder ...
0
votes
0
answers
4
views
Problem with circular Relashionship in async SQLAlchemy
I have the following sqlalchemy structure for some objects:
class Test(Base):
__tablename__ = "test"
id: Mapped[int] = mapped_column(Integer, primary_key=True, autoincrement=True)
...
-1
votes
0
answers
18
views
How to use CSV in function [closed]
I wrote this code but I do not know how to add my CSV files to it
import hashlib
import csv
from collections import OrderedDict
hp = OrderedDict()
akahr = OrderedDict()
def hash_password_hack(...
-1
votes
0
answers
10
views
FastAPI,ResponseValidationError
I am learing Fast api and going with the tutorial,but stucked here although i have written the same code as his but i am getting the responseValidation error.
this is get post code:
Code of get post
...
0
votes
0
answers
4
views
Azure Price Sheet API returning 404 error
I want to fetch the pricesheet for the Azure items on my subscription, considering any potential discounts. I understood from the API documentation, that using the billing period method would return ...
0
votes
0
answers
15
views
Why does `blake2b` on a `numpy` array give different results in different machines?
I ran the following code in two different machines:
import numpy as np
from hashlib import blake2b
print(blake2b(np.array([1, 2, 3])).hexdigest())
The two machines print a different result. Why ...
0
votes
0
answers
5
views
Does Starlette SessionMiddleware store session data on the server or on the client?
I am developing a stateless FastAPI app. The authentication is handled via Google OAuth (openid email profile scope). I am using Authlib and it uses SessionMiddleware (request.session) to store ...
0
votes
0
answers
7
views
How do I add a new font to a fpdf2 doc I'm hosting on google cloud functions?
I have a python google cloud function that should create a pdf when triggered, but the code seems to breakdown, seemingly because of the font, see below.
I tested the workflow with my local ...
0
votes
0
answers
9
views
What Is the best ML API for a Deep Audio Classification Model on the Raspberry Pi 0 2W?
I'd like to get your opinions on which ML API would be best for building an audio classification model. This model will be deployed on a small Raspberry Pi (Raspberry Pi 0 2W; could be something ...
0
votes
0
answers
9
views
Python matplotlib - draw rectangles with small inner padding (in pixels) that adjust automatically when zooming
I need to draw rectangles with small amount of INNER padding (e.g. 2 px) so that they don't come in contact with immediately adjacent rectangles. I would like the padding to remain constant after any ...
-3
votes
0
answers
25
views
line 6 else print('not good') ^^^^^ SyntaxError: expected ':' [closed]
salary = int (input('enter your salary: \n'))
hours = int (input('enter your hours: \n'))
total_salary = salary * hours
if total_salary<200000:
print('good')
else print('not good')
I want to ...
-1
votes
0
answers
11
views
I am recieving a NoReverseMatch error does anyone know what I'm doing wrong?
Im trying to allow the user to edit an existing entry. But when I include
new_entry.html
`{% extends "learning_logs/base.html" %}
{% block content %}
<p> <a href="{% url '...