Category "python"

Share django transaction across threads

I've a problem where one API implemented in a django (3.2) web app running with gunicorn (gevent) has to fetch different prices from multiple APIs and store tho

Why is Tensorflow image classification model overfitting? [closed]

I've been working a food image classification model. I started off with the TensorFlow tutorial and modified the model (code below). The model

Scraping google play reviews

I am new to programming and I have recently tried to scrape google play reviews with python using the following program: from bs4 import BeautifulSoup import u

How to invoke Cloud Function from Cloud Scheduler with Authentication

I've looked everywhere and it seems people either use pubsub, app engine http or http with no auth. Not too many people out there showing their work for accessi

Python multiprocessing with macOs

I have a mac (MacOs 10.15.4, Python ver 3.82) and need to work in multiprocessing, but on my pc the procedures doesn’t work. For example, I have copied a

Sympy : simplification with expression substitution

I have several expressions involving the norm or norm squared of a vector u. I'd like to simplify these expressions by substituting a known value for the norm o

Why does sphinx autosummary not create a toctree when used inside a class?

I am trying to use ..autosummary to document a module that replaces itself with a class upon import (lazy importing). Without lazy imports the module looks like

Pyinstaller Is Not Recognized

I know this question has been asked before and I have researched and used the following steps to no avail, each one of them: Pyinstaller is not recognized as in

how can i insert text file values in a dataframe column

def read_text_file(file_path): with open(file_path, 'r') as f: stop_words(f.read()) # iterate through all file for file in sorte

Calculate The Discount of a Product using a Python Code

I am currently trying to create a code that will calculate the discount (in percentage) of a product. The code is supposed to ask the user of the code for the

Make Seaborn Distplot and Barplot the same color [duplicate]

I have been unable to figure out how to set the colors between distplot and barplot to be the same. Despite setting the color argument in both

Find syntax error IN SQL query using python

I want to parse sql file using python code and find any syntatical error present in the file. Is there any way to do it?

cv2.error: OpenCV(4.5.2) 👎 error: (-5:Bad argument) in function 'cvtColor'

this is my code and I have a problem. What is the solution for it, please? I try to make a screen recorder: import numpy as np import cv2 import pyautogui code

AWS other modules cant be imported as soon as psycopg2 module is installed

I have installed some python libraries ands added them to a layer of a function. I have got the error which said "errorMessage": "No module named 'psycopg2'" So

How do I add a shadow to AutoShapes using Python-pptx?

I just want to add a shadow to the shapes that I am creating while using python-pptx. I have read as many documents about using shadows in python-pptx as I can

Header x-rapidapi-proxy-secret not forwarded by Heroku

I wrote and API with RapidAPI and deployed it on Heroku. I then listed the API on RapidAPI marketplace which uses a x-rapidapi-proxy-secret header to help me ma

Singular Value Decomposition (SVD) outputs a 1-D singular value array, instead of 2-D diagonal matrix [Python]

I was posting a question on similar subject, and encountered another more important question. When I apply SVD to a matrix 'A' (code below) the output I get is

non-iterable ellipsis in Flask_Restful parser.parse_args()

I've come back to a project I worked on previously, utilising flask RESTful, though whenever I attempt a post request the line args = parser.parse_args() breaks

Python-pptx - Inserting a picture into a shape & animations

I'm trying to make a python script using python-pptx but I struggle with inserting a picture into a shape. Basically, I need it for making the picture transpare

Data cleaning before, during or after data ingestion?

I am building a self-contained data analytics project in Python. As the project needs to be scalable it requires a fairly solid pipeline of data processing and