Category "python"

RGB to V (from HSV)

I am trying to convert an RGB image to its Value component. I cannot use the RGB2HSV function because I have been instructed to convert it without it. If I am n

Scrapy INSERT into "new_table" only if records do not exist in "current table"

I tried some website scrapping. I success scraped datas in my current db table. But I would like to INSERT into "new_table" only if records do not exist in "cur

python vscode environment variables not available

I have attempted to follow the directions for environment variables in my project and thought I was doing the correct thing but it does not appear to be working

dask bag embarrassingly parallel but with a generator

Example code: import dask.bag as db from dask import delayed from dask.distributed import Client, LocalCluster N = 10**6 def load(): return delayed(range(N

POST request to FastAPI using Python Requests with a file and query parameters

I am using FastAPI to serve some ML models and I have a Streamlit basic UI using Python Requests module. One of my service is getting an image through a POST re

How do I change the only the first word of every line in a text file?

So I have actually worked out how to change the first word but the problem is its not just changing the first word only. So i have a file such as : 2 0.268278 0

Import CSV file (convert to JSON format) into Deta Base (database)

I try to convert the CSV file into JSON format and import it into Deta Base (database). Here is a main.py code I run from a terminal. No error shows up, but Det

How to remove excess whitespace in matplotlib legend for PGF plot

I'm creating a fairly small plot with matplotlib which needs to include a certain legend. However, while space is tight, for some reason matplotlib makes the le

REACT Frontend not talking to backend despite Flask-CORS

I'm writing an application REACT frontend and Flask backend (with Flask-cord installed). When I make a call from the frontend I get an error Access to fetch at

xlwings book open excel workbook but change the file name to lowercase

I used xlwings to open excel workbook. It worked fine up to last month. But today, when I run the same code, it opened my worksheet but convert my worksheet nam

Unable to get the value from the drop down from html to python program in flask

I fetch the data from Mysql and populate the values to my html form in a drop down menu.Once the user selects the option, the value which gets sent back is only

The window i made with qt designer doesn't show up

I made this window using qt designer i did not add the code that downloads the songs yet but when I run it the window doest show up from PyQt5 import QtCore, Qt

Download report from app store connect API price

I can't find anywhere. I want to use appstoreconnect API for automatic process of raport using python. So Does use appstoreconnect reporting API is free? https:

Trying to save image from numpy array with PIL, getting errors

trying to save an inverted image, saved inverted RGB colour data in array pixelArray, then converted this to a numpy array. Not sure what is wrong but any help

Calculations on a pandas DataFrame column conditional on another column

I notice several 'set value of new column based on value of another'-type questions, but from what I gather, I have not found that they address dividing values

Flask Babel RuntimeError: Working outside of request context

I tried to set up multiple Dash Apps inside a Flask App and use Flask Babel. from flask import Flask, request from flask_babel import Babel, gettext from werkze

How to fix Spacy Transformers for Spacy version 3.1

I'm having the following problem. I've been trying to replicate example code from this source: Github I'm using Jupyter Lab environment on Linux and Spacy 3.1 #

delete all rows from first 3 columns of a worksheet (keeping the row with column names) using openpyxl

I am relatively new to Python. I am unable to figure out how to delete all rows (without deleting the row with column names) of specific columns with openpyxl.

How to authenticate to Azure Devops by using token of an Application ID(service principal)?

I have an Azure Devops pipeline where i have automated the creation of a service connection for azure subscriptions and also triggering the stage 2 of the pipel

Why is the code not plotting the expected output?

country = str(input()) import matplotlib.pyplot as plt lines = f.readlines () x = [] y = [] results = [] for line in lines: words = line.split(','