Quantcast
Channel: Active questions tagged python - Stack Overflow
Browsing all 23160 articles
Browse latest View live
↧

Controlling raspberry pi bluetooth with a python script

I have a raspberry pi 4 model b running raspbian-lite 64-bit with Operating System: Debian GNU/Linux 12 (bookworm) and Kernel: Linux 6.6.20+rpt-rpi-v8.I have to control the Bluetooth of the raspberry...

View Article


Image may be NSFW.
Clik here to view.

Implementing n-player Elo rating in pandas dataframe

Sorry if this is a rather complicated question.I have a pandas dataframe that records the result of races between different players:Race_ID records different racesRacer_ID records different playersN...

View Article


How exactly does tensorflow perform mini-batch gradient descent?

I am unable to achieve good results unless I choose a batch size of 1. By good, I mean error decreases significantly through the epochs. When I do a full batch of 30 the results are poor, error behaves...

View Article

Overload function with SupportsInt and not SupportsInt?

I want to overload the function below so if passed a value that supports int() Python type hints int otherwise Python type hints the value passed.Python typing module provides a SupportsInt type we can...

View Article

PyBind11 Module ImportError: cannot dynamically load executable

I'm attempting to generate a python module using pybind11, which compiles properly (I think) but when loading the module I get a "cannot dynamically load [position-independent] executable". If I don't...

View Article


pyenv is killed during module installation?

I installed pyenv (on Debian 12) as I need to run a program that uses python 10.Now I also need a module called local-attention.So I tried to install it with pip:pip install --user...

View Article

Image may be NSFW.
Clik here to view.

How do I destroy frames and make it appear the way it was before in tkinter?

In the code below, I'm destroying frame1 and frame2, so that the messages can make use of the extra space after destroying frame1 and frame2.The functionality I need is:When a message is sent, frame1...

View Article

How to replace double quotes within double quotes in a string with a specific...

name = "HIGHLY"SUCCE?SS+"FUL"RATE"i need a Python code where I need to replace double quotes with {+} except the ones in the ends, that is replace 2nd and 3rd and 4th double quote with {+}Result...

View Article


How can I customize Django Rest Framework documentation without using...

I'm currently working on a Django project and utilizing Django Rest Framework (DRF) for building APIs. I've integrated drf-pectacular for automatic API documentation generation, but I'm finding that...

View Article


Integral form of cdf in Python

I want to use a mathematical model of this kind. How do I find the exact integral form of cdf(x) which Python uses in this context?from scipy import statsdef model(x, x0, s, A, c): law =...

View Article

Unable to install dlib in vs code & Python

This error I am getting whenever I try to install.enter image description hereThese are the versions of Py and Cmake I haveenter image description hereI have to download the Dlib but the problem i am...

View Article

python try except misuse - what should i use instead? [duplicate]

I'm working with an external API and trying to automatically feed data from it into my own application.Let's say that the API call i'm making always has the fields 'length' and 'girth' and sometimes...

View Article

Unable to use variable from popup form, I am using this as .py file [closed]

I have created simple form to get user input but I am unable to retrieve those values when I need to be used, there are 3 inputs project id, layout id and format based on that need to make url and get...

View Article


I found the quoted error showing "This MinMaxScaler instance is not fitted...

from sklearn import preprocessingsx = preprocessing.MinMaxScaler()sy = preprocessing.MinMaxScaler()scaled_X =...

View Article

Validate a recursive data structure (e.g. tree) using Python Cerberus (v1.3.5)

What is the right way to model a recursive data structure's schema in Cerberus?Attempt #1:from cerberus import Validator, schema_registryschema_registry.add("leaf", {"value": {"type": "integer",...

View Article


Why are python timezone.utc and ZoneInfo("UTC") not equivalent tzinfo...

Why are these not equal?>>> from datetime import datetime>>> from datetime import timedelta>>> from datetime import timezone>>> from zoneinfo import...

View Article

Scipy root equation solving

I have a problem when solving a system of equations. To understand the code,the term: (1. - Ni_oct + delta_Ni_mod) used to be a variable. But I have to implement it in order to remove one equation that...

View Article


Trying to use Python & Selenium to click on a slider/checkbox

I'm trying to use python & Selenium to click on a slider/checkbox on a website and I'm having a lot of difficulty. I can simply find the element by ID (1369) and click on it no worries, except the...

View Article

Docker file with Ubuntu, Python and Weasyprint - Problem with venv

I am trying to get a docker image with Ubuntu, Python and Weasyprint to work.I think the error for me is that requirements.txt is installed in a Python venv. When I try to run main.py it gives me a...

View Article

How to make a BFS Algorithm in Micromouse Simulator?

Im a beginner in python and i have this activity in a class. Basically, i need help in making an algorithm in python to run in MMS(Micromouse Simulator. https://github.com/mackorone/mms. This is the...

View Article
Browsing all 23160 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>