Category "python"

Dynamically create CSV files for each section of a config.ini file

I am working on automating status reports using Python and the Jira API with a config.ini file. My goal is to have a config file where users can supply a jql st

Error when trying to download wxPython on Windows

Completely new to python, running command ‘pip install -U wxPython’ in Command line and this is the error I get: C:\Users\Pikachu>pip install -U

Get key=value pairs from a string with regex

I have a string that looks something like: x = """\ names=['m','c'], \ nmodes=2, \ mus=[[-5.0, -5.0], \ [5.0, 5.0]], \ sigmas=[[1.5, 1.5], [2.1, 2.1]],

Labels -1, 0 and 1 for classification in Tensorflow

I am trying to write a model that outputs a vector of length N consisting of labels -1,0 and 1. Each of the labels depicts one of three decisions for the system

Retrieving swapped token addresses from etherscan using web3js

I am trying to retrieve the token addresses of tokens swapped (and amount of tokens swapped) in a single transaction. I am using the "web3.eth.get_transaction(h

How to add element to array at firestore database? (python)

I need to add some value (val) to existing array in google.cloud.firestore document. I found solution like that: database.collection('collection_name').document

Convert a list of dict of [{str:int}, {str:int}, ... ] to a single dict of {str:int}

Given a data-structure like this: [{'a':1, 'b': 2}, {'c':3 }, {'a':4, 'c':9}, {'d':0}, {'d': 0, 'b':6}] The goal is to parse the data to produce: {'a': 2.5, 'b

Django update bootstrap modal not updating untill refresh

Django bootstrap modal form works when i create new data gets populated and pop up closes automatically without refresh but when updating success message appear

Why does ctypes find my dll but not my function?

I am trying to rewrite an 32bit Matlab-script in Python. For this I need to include a dll, which I am trying to do with ctypes. Somehow the Python script does f

xarray discrete scatter plot: specifying legend/colour order

Plotting a discrete xarray DataArray variable in a Dataset with xr.plot.scatter() yields a legend in which the discrete values are ordered arbitrarily, correspo

how do i convert a .csv file to a .data file?

Does anyone know how to convert a .csv file to a .data or know how to use only half of a .data file like a csv file? I'm trying to achieve a mean Average Positi

xarray discrete scatter plot: specifying legend/colour order

Plotting a discrete xarray DataArray variable in a Dataset with xr.plot.scatter() yields a legend in which the discrete values are ordered arbitrarily, correspo

Adaptive Threshold for Noise Reducing

how to use the adaptive threshold to remove noise in images using python code? I just know that OpenCV's adaptive threshold is only used for image Thresholding,

flask_sqlalchemy keeps trying to connect to localhost database instead of the remote one

I'm trying to use the flask_sqlalchemy library in order to connect to a PostgreSQL server on my remote Ubuntu machine, but my app keeps trying to connect to the

flask_sqlalchemy keeps trying to connect to localhost database instead of the remote one

I'm trying to use the flask_sqlalchemy library in order to connect to a PostgreSQL server on my remote Ubuntu machine, but my app keeps trying to connect to the

subprocess.run produces different result if launched from Python, versus Matlab

I have a Python 3 class that creates input to send to a fortran program (xfoil). I am using subprocess.run to launch the fortran binary and send the command inp

no such file libmariadb.3.dylib error when importing MySQLdb on mac M1

I migrated my data to M1 Monterey MacOS from intel macmini. I was happy to use django and mariadb until I installed a package using homebrew. I installed homebr

Why does this keep returning the last value of the dictionary?

So i'm practicing my nested dictionary skills with this data: content = {'results': [ {'_class': 'question', 'course': {'_class': 'course',

Find the best feature value to reach the largest predicted value without iterating with sklearn estimator

I have a complex system with a lot of parameters, each parameter interact with others. I could have some parameters values of this system at one time ("a", "b",

How to integrate backspace functionality in a program?

I have created a program that prints a character whenever that character is pressed but when i press "backspace" button to remove the last entered character the