Category "python"

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

Apache Beam with Dataflow: flag 'ignore_unknown_columns' for WriteToBigQuery not working

I am building a streaming pipeline using Apache Beam (Python SDK version 2.37.0) and Google Dataflow to write some data I receive via Pubsub to BigQuery. I proc

plotly dash link to local html file

i want to link a local HTML file to a plotly dash table. from dash import Dash from dash_table import DataTable import pandas as pd df = pd.DataFrame( {

Caused by: java.net.SocketTimeoutException: Accept timed out

I am getting this error while running pyspark package in pycharm using python 3.9 using this below code. from pyspark.sql import SparkSession from pyspark.sql.t

Pytest logging ignores dependency warnings

I have a simple python script that leads to a pandas SettingsWithCopyWarning: import logging import pandas as pd def method(): logging.info("info") l

How to customize general error messages of numpy?

I am writing a Vector and Matrix classes that use numpy in the backend in order to abstract some common methods and calculations (specifically, physics calculat

Conversion between binary vector and 128 bit number

Is there a way to convert back and forth between a binary vector and a 128-bit number? I have the following binary vector: import numpy as np bits = np.array([

How to make SPOT market order on Bybit with ccxt?

I am using ccxt library to work with exchange. Struggling with making market order on Bybit. How it can be fixed? The error i've got is TypeError: Exchange.requ

Add a comma after two words in pandas

I have the following texts in a df column: La Palma La Palma Nueva La Palma, Nueva Concepcion El Estor El Estor Nuevo Nuevo Leon San Jose La Paz Colombia Mexico

Django context processors available globally to templates in ALL apps

I am new to Django/Python, and am trying to figure out the best way to have global constants in my project that are available to templates in ALL APPS in the pr

Is there a simple way to compare two class objects for all items that are not none?

I am looking to compare two instances of the same class, but only the items for which both are not None. for instance, I will have a Bolt class, and one instanc

Generate binary outcome dummy data based on probability of items and its feature

I want to generate a synthetic data from scratch which is a binary outcome sequence data (0/1). My data has following property- For the sake of an example, lets

How to correctly compute the gradient of a curve using numpy gradient?

I have a curve which is composed of 1200 values and i just want to compute its derivative so i use numpy gradient function. Here is the code i'm using: data = n