Category "python"

ERROR: airflow.exceptions.AirflowException: Use keyword arguments when initializing operators

this the error log showing when i am trying to run the program in apache-airflow UI ERROR [airflow.models.dagbag.DagBag] Failed to import: /d/Program Files/meta

REGEX_String between strings in a list

From this list: ['AUSTRALIA\nBELMONT PARK (WA', '\nR3\n1/5/4/2\n2/3/1/5\nEAGLE FARM (QLD'] I would like to reduce it to this list: ['BELMONT PARK', 'EAGLE FARM

Cast type at index time of document

Once ES has dynamically mapped a type to a specific field, is it possible to automatically cast all future values to this type? Specifically, I want to do this

Issues with downloading file from website using python request

I have the following code: import requests r = requests.get('https://etf.invesco.com/de/private/de/product/invesco-kbw-nasdaq-fintech-ucits-etf-acc/reports/Inde

Can I iterate through the widgets in a databricks notebook?

Can I iterate through the widgets in a databricks notebook? Something like this pseudocode? # NB - not valid inputs = {widget.name: widget.value for widget in

Importing a data frame from CSV file using Pandas with column name having spaces

I am trying to import a data frame from a .csv file which contains Per Capita Income. Moreover, in the above mentioned file the column name is Per Capita Income

How to run FastAPI server as multiple instances

I have developed a FastAPI Web Application. If I run the server and it is down or crashed for some reason. I need multiple instances of server to be running. I

How should I pass a function that runs an external file to be able to use multiprocessing?

I recently saw a module that allows me to run my code simultaneously which happens to be what I need. However, as I was testing with function, I ran into some e

Need a python code to find out the Local Binary Pattern and Gabor Filter of all the superpixels individually

I am doing tumor segmentation for my project and have used the SLIC function from scikit- image mark boundaries to create this grid. I am creating a feature vec

How to start neo4j server (desktop edition) using python and without launching the desktop application?

I'm using neo4j Desktop Edition v4.4 & I've already integrated it with python (3.10) to create nodes and relationships.. this part is working fine, but I ne

How can I eliminate this disproportionate vertical gap between my x-axis and data in matplotlib? [duplicate]

I have been testing a regression model by graphing its output in matplotlib, but when I do I end up getting a really tall graph with a gap in

Trying to open image with pysimplegui, but getting error window pop up

I am following this tutorial to try and get an image to show up in a window with pysimplegui. https://www.youtube.com/watch?v=KtlGrgWf6Y8 import PySimpleGUI as

Trim data on matplotlib diagonally

Can anyone help me with how to trim plot data on the left side of this straight line besides doing it manually on excel? Thanks enter image description here I'm

Weird timezone issue with pytz

>>> import pytz >>> pytz.timezone('Asia/Hong_Kong') <DstTzInfo 'Asia/Hong_Kong' LMT+7:37:00 STD> A seven hour and 37 minute offset? Th

MySQL slow concurrent/parallel queries in Python

We are using very simple SELECT … WHERE queries (1000 rows, from a very small table with 18000 entries) to load time series data for plotting (for testin

Can I deal with vector fields in sympy without specifying coordinate system?

I have differential equations for two vector fields: diffusion equation for magnetic field and Navier-Stokes equation for fluid velocity. I am interested in tra

Keras semantic segmentation, infinite epoch using ImageDataGenerators

I am trying to train a model based on the U-Net architecture. I am using two data generators (one for training, the other one for validation). However, whatever

tag occurrences of a value multiple times inn column based on dates using pandas [duplicate]

Below is my dataframe: df = pd.DataFrame({'ID':[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], 'date': ['2020-12-1', '2020-12-2', '20

SHAP KernelExplainer AttributeError numpy.ndarray

I've developed a text classifier of the form of python function that can input a np.array of strings (each string is one observation). def model(vector_of_strin

It keeps outputing error: Not all parameters were used in the SQL statement

def getLevels(userName, levelID, levelName, levelLength, coins, starStars, amognus): try: statement = "SELECT userName, levelID, levelName, levelLength, coins