Category "python"

Lithuanian stemming algorithm

I've been trying to execute lithuanian snowball stemmer in Python. There is a github link where a guy shows how to integrate it using Python but I'm stuck at co

python async with AsyncKernelManager and Qt not executing

I'm trying to execute code inside a jupyter kernel in a Qt application. I have the below snipplet that is supposed to asynchronously run the code and then print

How to error handling curl and mysql in python subprocess.run()

I have python script which uses subprocess.run() getting dump file by curl and input dump file by mysql cmd = "curl {0}/{1} -o /tmp/{2}".format(dir_name,file_na

Python: I have a list of dictionaries but when I try to call a specific Key and Value it is throwing a error

def readParksFile(fileName="national_parks(1).csv"): nationalParks = open(fileName) headers = nationalParks.readline() keys = headers.split(",")

django if user.is_authenticated not working but login user

my problem is that the login operation is done correctly and the session is set up correctly, but user.is_authenticated does not work. The point is that it work

Python code for ozone reaction in FDM scheme

How can I use the Forward method for finite-time differencing to build a single box model for a third-order ODE? Just so you know, I am a beginner in coding in

Keras model with 2 inputs

I am dealing with a binary classification problem that feeds a network with two inputs (images), model_vgg16_conv = VGG16(weights='imagenet', include_top=False)

Find pivots in tensor that maximize sum of values

Let's suppose I have a matrix like this: [[15,10,8], [11,5,8], [9,14,4]] I need to write a function that, for each row, returns the indices of the maximum valu

Github Actions workflow : can't change working directory - Error: An error occurred trying to start process '/usr/bin/bash' with working directory

I want to create a Github workflow to run the tests of my Flask application at each merge request. This is the first time I'm writing one so I'll take any advic

Apache Spark Dataframe - Get length of each column

Question: In Apache Spark Dataframe, using Python, how can we get the data type and length of each column? I'm using latest version of python. Using pandas data

Runnig Python in Atom on MacBook doesn't work any more

I have installed and set an Atom on my MacBook. I have installed packages like a script, atom-python-run. I have installed the latest python from their official

tkinter creating buttons in for loop passing command arguments

I am trying to create buttons in tkinter within a for loop. And with each loop pass the i count value out as an argument in the command value. So when the funct

How to remove gaps between adjacent matplotlib patches

I am trying to plot a collection of finite element data with colored patches used to represent the value in each element. Unfortunately, when I plot the patches

How To Find New Business MRR From Existing MRR in Pandas

Current Code is whole MRR but How to find New Business MRR cnts=[] dat =[] tp = [] mnth = [] for i in date_range: df3 = df[(df.TotalPrice > 0) & (df.

why does changing global variable not work in pyspark?

i have two python scripts. the main script is like from testa import modify, see from pyspark import SparkContext if __name__ == '__main__': sc = SparkConte

How to decorate a test to xfail a specific case with multiple parametrization?

Is there a way in pytest to xfail a test when a specific parametrization condition is met? Note the parametrization is on fixture, not using mark.parametrize. f

Insert new data to dataframe

I have a dataframe employees = [('Jack', 34, 'Sydney' ) , ('Riti', 31, 'Delhi' ) , ('Aadi', 16, 'London') , ('

Upload a package to multiple package managers from a single repo

I had created a python package Categorize-CLI and had uploaded it to pypi, the source code of the project is available in Github, is it possible to upload this

using DDE get a response from Python to VBA in MS Access

I have a need to pass strings back forth from a python script to a VBA application running in MS Access. Communication from VBA to Python works great! Communica

tkinter tab width incorrect

When creating text on a canvas using the create_text method the width of a tab is not what it should be, as indicated by font.measure. import tkinter as tk from