Category "python"

XGBoost regression predictions are shifted along the y axis

XGboost regression output is scaled on the Y axis as shown in the image below. Ytest vs Ypred I have provided the code below which got me these results. Tried s

numpy array custom dtype for the list of list

I am confusing in using custom dtype of numpy array which is converting the element of the list to be tuple. np.empty (1000, dtype = [('a',int), ('b','S4')]) t

Serverless framework can't connect to existing REST API in AWS

Hello and thanks in advance for the help, Im trying to connect my serverless file to an existing API Rest in AWS but when I make the deploy it fails with the me

How to send and receive data in XML format using WebSockets and FastAPI?

I'm trying to communicate with a fingerprint device. Actaully it sends data through websocket connection. So, I think I can communicate with the device using we

How to evaluate a polynomial at a specific x-value?

Use map to evaluate a given polynomial at a specific x-value. Input: p: A list of coefficients for increasing powers of x x: The value of x to evaluate Output:

How to make tkinter work with discord.py?

I want to control my discord.py bot with tkinter buttons, but when I place client.run(token) above tk.mainloop() the discord.py bot runs, but the tkinter window

How to exclude last line from scraped content in python selenium

content = driver.find_elements(By.XPATH,'//div[@id="content"]/p') Now there is a list of paragraphs that were scraped, like- content[0],content[1].....content[

SQLITE3 + Python (I need to ask bank 1 table if its data exists in bank 2 table)

I have a doubt about python and sqlite3. import sqlite3 conna= sqlite3.connect('db_a') a = conna.cursor() connb= sqlite3.connect('db_b') b = conna.cursor() I

How to create a parametrized fixture that is dependent on value of another parametrized fixture?

Example: from pytest import fixture, skip @fixture(params=['a', 'b']) def f1(request): yield request.param params = [('a', 1), ('a', 2), ('b', 10), ('b',

I am having trouble setting a GIF in an embed in discord.py

I currently have a list of gifs in a list in a different python file(I don't know how to use json) and I have for an embed embed.set_image(url=random.choice(gif

JavaScript Plotly.js How to create a 3D surface plot using x, y, and z coordinates?

I have read a few questions on this topic (although most were for the python version of this library) and none have worked for me. I want to create a 3D surface

Standalone exe file Python without Python installed

I am trying to create executable file from Python script with os, tkiner, pandas and xlsxwriter packages. I used pyinstaller, but always get error that pandas i

How to use variable's value as HTTP POST parameter?

I am trying to send HTTP post request to an API, but instead of using preset text values as POST data, I am trying to use the variables, but can't seems to figu

Python: How to recursively merge 2 dictionaries? [duplicate]

Suppose we have 2 dictionaries: a = { "key1": "value1", "key2": "value2", "key3": { "key3_1": "value3_1", "key3_2"

Semantic segmentation with detectron2

I used Detectron2 to train a custom model with Instance Segmentation and worked well. There are several Tutorials on google colab with Detectron2 using Instance

Is there an implemented way to use a kubeflow pipeline's output outside the pipeline?

I'm using local kubeflow pipelines for building a continuous machine learning test project. I have one pipeline that preprocess the data using TFX, and it saves

How can solve problem in installing build tools

I'm trying to install build tools on my OS (Windows 10) but it always stay in the same state. Like picture Build tools error image PS C:\WINDOWS\system32> np

Can't import file from another directory which imports a file from the same directory (int Python)

So my project structure is the following: project/ src/ __init__.py utils.py model.py usage.py I now want to import functions f

Ingesting An Null Int Column: Pandas and Pandera

I am using pandas with pandera for schema validation, but I've run into a problem since there's a null integer column in the data. from prefect import task, Flo

Py4JJavaError: An error occurred while calling o143.parquet

So I have parquet files in S3 bucket and I want to load it using pyspark in python, but I'm getting some error, here's what I have tried so far. I'm using Juput