Category "python"

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

How to change the node tensor type on an entire PyTorch Geometric Dataset?

Is there a function to change the tensor type (from long to float in my case) on the node features of every graph in a pytorch geometric dataset? Iterating over

Pandas Groupby with Aggregates

I am working with pandas and I was wondering if there is a difference based on which statistical functions are applied as shown in the below examples and if the

I am confused about these python errors [duplicate]

So, I am developing this game where the graphics is made entirely of text. This prototype looks right but there are some errors in the program

Expand 2-D Numpy integer Array as binary but in parallel

I want to convert arrays of integers to 0 or 1s, padding with 0s if the other array possesses the larger value. Examples: ex1 = np.array([[0],[3]]) => array(

How to handle special characters in the string while updating a table using python

Im trying to update some rows to a table, in one of the row a string is having few special charecters. I should be updating the string as is to the db. I have t

How to pass ctx argument to own function?

It isn't exactly my code but similar example: Function body: async def fun(fun_word) ctx.send(fun_word) Then main code: @client.event async def on_message(me