Category "python"

Trying to load data for ml project in jupyter notebook but having issues with dtype

I'm trying to load images into my jupyter notebook but I'm getting this error TypeError Traceback (most recent call last) TypeE

Load new values from another Python script

I have a device which I am controlling in a for loop. I would like to check every iteration if a .txt file has changed. If it has I want to read values and send

How to make fixed ticks for graph using matplotlib [duplicate]

I am trying to make a graph with fixed ticks, regardless to the points values. For example, I want the ticks to be 0-6, and the points values

os.path.isdir() returns false

I'm trying to check if a folder exists by path = r"This PC\Bassel's Note\Internal storage\Audiobooks" print(os.path.isdir(path)) It always returns false even t

Listing files and folder in Sharepoint with Office365-REST-Python-Client responds : 404 not found error

I am trying to list files from a folder. It works with folder name with spaces but doesn't work when folder name contains '#'. I am getting below error office36

Using fstring with nested quotation marks for a xpath - triple quotes didn't work

/!\ The problem here is a f-string problem; I know how to click the "onclick" element in another ways, but I want to understand why it doesnt work THAT way /!\

Stop a function after a thread process is done runnig

i made a little GUI to take input from the user one of the main process is withing a thread and since that command starts there's an event that triggers an endl

Python: Extract r,g,b values from point cloud

I have a point cloud (ply file) with X,Y,Z and r,g,b values only. Here is my ply header file. ply format ascii 1.0 comment generated by pdal element veryex 6245

How to pass python 2d matrix to C function ctypes

I tried to pass my matrix from python to C++ based on ctypes to multiply by 2 but I could not get the result that I want because it says inf instead. C code (DL

Python lxml cannot handle XML element with over 1GB of text

The lxml library for Python can handle extremely large XML files, up to (and over?) 100 GB in size. But can it handle extremely large (1 billion characters or m

Pandas Merging 101

How can I perform a (INNER| (LEFT|RIGHT|FULL) OUTER) JOIN with pandas? How do I add NaNs for missing rows after a merge? How do I get rid of NaNs after merging?

convert a CSV file to JSON file

I am trying to convert CSV file to JSON file based on a column value. The csv file looks somewhat like this. ID Name Age CSE001 John

i'm getting this error when running the below pyflink code

this is the code for calculating average of each ch[x] from a kafka source using apache flink(pyflink) i think i have imported all of the necessary libraries An

Using scipy fsolve and odeint for simultaneous ODEs

I'm trying to solve a set of transient flow equations of a body firing from a pressurised tube from scipy.integrate import odeint import numpy as np # paramet

Comparing lists within dataframe column to another list using numpy's where function

This is my first post at Stackoverflow, so thank you for the help. I am trying to replicate a code where I can match a list within a dataframe to another list,

How do I decode the hex from a specific part of a BSC transaction receipt, using web3 py?

I am writing a python script using web3 package. The process explained: I have a transaction, which I read the transaction receipt for txn_receipt = w3.eth.getT

Pytorch model object has no attribute 'predict' BERT

I had train a BertClassifier model using pytorch. After creating my best.pt I would like to make in production my model and using it to predict and classifier s

Custom rate for adding user to test process in locust

I'm pretty new to locust and load testing, I need to write a load test that should be for a total of 30 users, these users should be added to the test step by s

Low accuracy after testing hyperparameters

I am using VGG19 pre-trained model with ImageNet weights to do transfer-learning on 4 classes with keras. However I do not know if there really is a difference

Creating Python zip for AWS Lambda using Bazel

I've a monorepo that contains a set of Python AWS lambdas and I'm using Bazel for building and packaging the lambdas. I'm now trying to use Bazel to create a zi