Category "python"

How can I fix this specific instance of a TypeError in python

# importing necessary libraries & my own library of functions called dependancies: from tkinter import N import Dependancies import pandas as pd import time

tensorflow 2 use keras.sequence as data generator for training machine learning model with multiprocessing error

I would like to do a test about training a machine learning model on EC2 instance with only CPUs from jupyter notebook. The code is tensorflow 2.8. Based on the

Iterating through integers not found in a list of ranges in Python

So, I have a function which outputs a list of ranges, e.g. [range(1,5),range(8,13)]. I need to iterate through those integers which are not in a range in this l

Getting the derivative of two functions g(f(x)) and h(f(x)) in one backward pass usin Pytorch

So I am passing an input x through a pretty large model f to get f(x). Then I use the output and pass it through one model g (including a loss function) to get

How to live stream python-generated audio signals?

I am working on a project that generates audio signals randomly. The Python program I wrote can generate continuous audio signals that I could, for instance, sa

Divide a list into sublists such that difference between any 2 elements in a sublist should not exceed k

Can anyone provide an approach for this. Divide a list into sublists such that the absolute difference between any 2 elements in a sublist should not exceed a '

Querying a nested JSON file in Python without Indexing

I have the below Json file which I need to query to get the values of the keys inside 'validations' in a list for example the column_values_not_null output will

how to print a vowpal wabbit regression model in contextual bandits setting

I am using vowpal wabbit for contextual bandit problem, in python. Vowpal wabbit has a prediction model that uses the doubly robust method to build a regression

Python Socket Listener error with connecting to bash reverse shell - `bash: cannot set terminal process group (1057): Inappropriate ioctl for device`

Python Socket Listener error with connecting to bash reverse shell - bash: cannot set terminal process group (1057): Inappropriate ioctl for device I am workin

Python - TensorFlow - Facial Recognition App

I follow guide to build facial recognition app , code runs in problem on training models every thing runs fine except the training models: any suggestions ? @tf

Split a comma delimited Pandas Column of Type Object

I have a pandas df with a column that have a mix of values like so | ID | home_page | | ---------| -----------------

Azure Synapse Serverless SQL Pools - how to optimize transformations using notebooks and load tables into ADLSG2

We use Synapse Notebooks to perform data transformations and load the data into fact and dimension tables within our ADLSG2 data lake. We are disappointed with

pandas groupby dropping columns

I'm doing a simple group by operation, trying to compare group means. As you can see below, I have selected specific columns from a larger dataframe, from which

Python-separate weekly date range from Sunday to next week Saturday

I am working on data cleaning with a data frame in Python, there is one column named datetime, I need to separate this column datetime to each week by range fro

How to get existing pivot table names and modify them using xlwings?

I am using xlwings(python3) to automate an excel report, need to find a way to get the names of all the existing pivot tables on a given sheet and then change t

3D plot not loading Python

Sorry I'm a beginner with Python and am unable to find a bug with this program because I get an infinite load. I am trying to plot 'abs(psi)' in three dimension

Download function: File does not exist - 'no file'

I implemented an upload and download button. The upload button functions properly, but when I click the download button it tells me that the file I want to down

python dictionary best practice

I am new to Python. I want to create a dictionary. Each key will have three values. Which is a better approach?: 1.One Dictionary like this: dict = {'a': [value

TensorFlow warning: Allocation of X exceeds 10% of free system memory

I just wonder what does it means the allocation number value(the X in the title of my question) in the tensorflow warning 2022-05-14 19:03:39.958223: W tensorfl

How to convert data in Polars?

I used .write_ipc from Polars to store as a feather file. It turns out that the numerical strings have been saved as integers. So I need to convert the columns