Category "python"

Why python's logging module stopped working suddenly?

For years I have been working with python and running massive data processes that run for hours or days. So logging for me is critical. I have been using loggin

Finding percentage of rejection in pandas dataframe

I have a pandas data frame like given below Id1 YEAR CLAIM_STATUS no_of_claims 1 2019-01 4 1 1 2019-01 5 1

How do I download a file returned from FastAPI backend using Fetch API at the frontend?

This is my FastAPI(python) code, which returns a .ics file: @app.get("/latLong/") async def read_item(lat: float,long:float): mainFunc(lat,long) return

syntax error in every python scripts SyntaxError: invalid syntax

File "account_creator.py", line 63 username = f"{first_name}_{last_name}{random.randint(1000, 9999)}"

python iterate through a list and skip n iterations within the loop every time a condition is met

the following code iterates through a list and counts every time the condition <10 is met. What I want to do is that once this condition is met, the next poi

(CLOSED) How to work with global variable in AWS Lambda (python)

I need an approach in AWS lambda to resolve an issue What am I doing now: I am looking to build a quick script to test my understanding on global variables. In

Adaline AI results in an overflow

I made an AI that uses the Adaline algorythm. It seemed to work but it results in an overflow if it's used with my own dataset. Here's the code: import sys imp

Selecting From multidimensional Numpy array with multidimensional mask

I am trying to build an example to understand image segmentation, you are given an image of shape (1,2,2,3) it's a 2x2 image where each pixel has 3 numbers indi

How to connect over sshtunnel to remote sql server with "2 jumps" in python

after days of research and fails with this problem. Context: I need to connect remotely from a python script to a remote database and I have the following restr

Azure Function Python Module compatibility issue

I am developing an Azure function using Python. This function is going to write some data to blob storage. This function having dependencies on couple of azure

binance.exceptions.BinanceAPIException: APIError(code=-1022): Signature for this request is not valid. how to make limit order?

I have a script that had order buy type: MARKET, but want to change it for LIMIT and get that error. How can I solve this problem? buy_order=client.futures_crea

Tensorflow_io: ValueError: Cannot infer argument `num` from shape (None, None, None)

I am trying to read and decode tiff images in tensorflow. I am using tensrflow_io package as follows, I am getting this error that I cant figure out. import ten

how to fix error Import "chess" could not be resolved

please help me fix error Import "chess" could not be resolved and many more errors like: Import "chess .pgn" could not be resolved, Import "chess.variant" could

close QDialog and back to the first QDialog

I just started learning Python and PyQt5, and I have this problem, I create two QDialog, the first one have a button to open the second, and in the second I hav

Instagrapi: Please wait a few minutes before you try again. WHY?

I used the code from @Xerneas 02, only it gives me this error. This Code from instagrapi import Client bot = Client() bot.login("username", "password") album

Merge PDF files by each folder

This Python script is Creates PDF file from List of Images. ( It have a series of folders inside a parent one. Each folder has several images) My current proble

Jupyter : [WinError 267] The directory name is invalid

I got the error while running a code: [WinError 267] The directory name is invalid: 'E:\\PlantVillage/Pepper__bell___Bacterial_spot/0022d6b7-d47c-4ee2-ae9a-392a

Is there a more efficient way to find index of an element without using list built-in functions?

We can get the index of an element in a list using the .index() function. I was wondering if there's any more efficient way to find the index without using the

cv2.error: OpenCV(4.5.2) .error: (-215:Assertion failed) !_src.empty() in function 'cv::cvtColor'

import cv2 #for image processing import easygui #to open the filebox import numpy as np #to store image import imageio #to read image stored at particular path

Customizing FloatText or Label widget in iywidgets

can someone please tell how to customize appearance of the FloatText or Label widget in ipywidgets. I am using Jupyter notebook. I know of 'layout', but it dose