Category "python"

How can I record system audio from my speakers using Python?

I looking for script to record system audio, not microphone audio. I mean when I play music with a media player I want record it. I want record the sound output

How can I extract ISO and ASTM standards from a text using regex?

I would like to extract the ISO and ASTM standards from a text. The corresponding literals ISO and ASTM followed by the numbers would have to be found. Rules: M

unittest jsut runs 1 out of 4 test cases

We have this assigment where i should run these four test cases with the help of unittest but when I run it with the command python test.py (name of the file) i

How to fix "No module named 'nmap'"

import nmap ModuleNotFoundError: No module named 'nmap' the above is the result when trying to run the code after importing nmap. (I have installed python-nmap

Is there a Numpy equivalent of C++ std::vector reserve(), push_back() and shrink_to_fit()?

I would like to append elements to en empty Numpy array in-place. I know the maximum array size beforehand. I can't find a direct way to accomplish that, so her

SQLite python not returning false on an empty select

Hi having some issues with SQLite3 been having a good time with it up until now but recently ran into some issues when I was trying to check if a select stateme

just installed Python, getting WinError 32 for any libraries I try to install

I just installed Python 3.10 on my work machine. I went to pip install pandas and got a Win32 error on a temp file within the AppData Temp Folder.I have tried

Python websocket with FastAPI does not return data immediately

I created a websocket connection with FastAPI to "stream" data which comes from a tedious calculation. The data chunks should be send as soon as they are availa

how to "transpose" datas from a date to another one in python

Sorry i had a lot of trouble explaining my problem in the title but i hope it will be more understandable with this example : i have a data source that tells me

Python: 'ModuleNotFoundError' when trying to import file from same directory

Running Python 3.10. I have three files in the same directory named Chess, one of which is a __init __.py to make sure it's considered a module. In one file, Ch

Function minimization with non-linear constraints using scipy.optimize.minimize 'SLSQP' method Error

I'm trying to minimize a maximum likelihood function with non linear constraints: #Maximum Likelihood import math from scipy import optimize #Define functi

line() got an unexpected keyword argument 'reuse_plot'. Not sure what this means

I am following a tutorial online to use Python to determine financial returns. I am getting an error "TypeError: line() got an unexpected keyword argument 'reus

When one of my column in dataframe is nested list, how should i transform it to multi-dimensional np.array?

I have the following data frame. test = { "a": [[[1,2],[3,4]],[[1,2],[3,4]]], "b": [[[1,2],[3,6]],[[1,2],[3,4]]] } df = pd.DataFrame(test) df a b 0

Negative dimension size error in tensorflow [duplicate]

so I have 2 images, img1 and img2 both with shape=(20,20), to which I expand_dims to (1,20,20) 1 being batch size and feed them to the network

Sending a message to twitch chat doesnt work

I'm creating a simple Twitch bot for personal use. I'm using twitchio.ext commands. Everything works fine, I'm connected, I'm able to print all the messages fro

Python: Get Surfaces from convex hull

I am new to 3D-Calculations and i searched for a while, but couldnt find any solutions (maybe I am using the wrong search terms). So i have different 3D-Point-C

Error uploading file to google cloud storage

How should the files on my server be uploaded to google cloud storage? the code I have tried is given below, however, it throws a type error, saying, the expect

How to select all the rows with 0

I have a dataset where I have some 0 values in it. I want to print all the rows having 0. I was able to print a single column, but can't find a way to print al

Mac doesn't read pytube package

I've a problem while making a YouTube downloader with pytube. I installed the package with pip3 install pytube python3 -m pip install pytube And I have python3

Python multiprocessing, parent process hangs at recv after child process raises exception before send

Python is definitely one of the worst languages for parallel processing. Just finna get the parent process to throw an error when the child process fails. Inste