Category "python"

Filter rows in dataframe based on value counts [duplicate]

I have a large dataframe/Questionaire df (871 x 24) containing a column named "Identifier" which stores an unique ID for each of the participa

Save multiple/distinct .CSV files after for loop execution

I have 65 xml files that I need to convert to .CSV, and save each converted file as a separate .CSV file. I have tried using a for loop but am not having any lu

my python package can be installed on my local conda env but can not be installed on other envs or systems

I have created my own python package and uploaded it in https://test.pypi.org/ which installed and worked fine in my conda virtual environment but when I want t

Quantify longest axis and width of irregular shapes within a single image

Original question I have about 80-100 images such as (A). Each image is composed of shapes that were filled with black color after marking the outline in ImageJ

How can I set up a VirtualBox interface using a Python library in 2022?

I have a local installation of VirtualBox running on my host machine, which is running Windows 10. I am able to start and run a virtual machine of Ubuntu via th

brownie AttributeError: 'NoneType' object has no attribute 'getEntranceFee'

Macbook Pro : Monterey Intel Core i7 Brownie v1.17.2 I am learning solidity according to reference(https://www.youtube.com/watch?v=M576WGiDBdQ&t=25510s). Wh

Python Json.decoder.JSONDecodeError: Expecting ',' delimiter:

I'm trying to load a dictionary into json but I'm getting error. strsdc = ''' {"ext":{"amznregion":["useast"],"someURL":"https://som_url.com/x/px/Iyntynt/{

splitting strings by list of separators irrespective of order

I have a string text and a list names I want to split text every time an element of names occurs. text = 'Monika goes shopping. Then she rides bike. Mike likes

Can't install python module "pywhatkit"

So I was working on a automated whatsapp messenger and I tried to install the module known as "pywhatkit" but I am getting an error everytime. The error trace i

Exit If Statement

I'm confused and stucked when im trying to quit/ continue in if statement def checkQuota(): with open("Discord\Test Field\config.json", "r+") as file:

How to get all tick ranges with non-zero liquidity to finally calculate Total Value Locked Uniswap V3?

The aim is to calculate the uniswap v3 pool's total value locked (TVL). import json from web3 import Web3 from collections import namedtuple infura_url = 'http

How can I keep the anchors and aliases as the are?

E.g. input file username: &username john password: &password xyz server: &servername 192.168.0.1 host: server: *servername username: *username p

Altair: persistent tooltip

I have a horizontal line that changes height depending on brush selection. Is there anyway to constantly display the line as the line goes up and down? Below is

[mac Monterey][Python 3.10.4][tkinter 8.6] Calling tkinter askOpenfilename crashes when repeatedly creating a window

I have a python program that allows users to repeatedly press a key that will create a tkinter window where they can open an image an manipulate it. The problem

PyFtdi Value Error 'No backend available' every now and then

I'm using pyftdi (https://eblot.github.io/pyftdi/) to handle a FTDI ft4232h. Everything usually works fine but every now and then I come across a ValueError say

Installing packages with pip

I have been advised using pip in a Anaconda virtual environment is bad. But some packages are not on conda or on conda forge. When I run conda activate virtuale

Problem of running samtools in python using subprocess.run()

I'm using subprocesss.run() to run samtools command in python. The code is as below: result = subprocess.run(['samtools', 'faidx', 'hg38.fa.gz', 'chr1:169699712

pip install PyQt6 producing "No matching distribution..." error

I've been trying to install PyQt6 on my Ubuntu machine, running Python 3.8.10. Following the instructions on the site, I have tried the following: I have also

how can i change the value of variable just for a specific function?

x=2 def fun(): y=x+2 print(y) def main_fun(): x=10 fun() print(x) fun() main_fun() fun() print(x) I want the that the value of x when i call m

Unzipping the zipfiles within a url zipfile python

I can unzip a url zip file of csvs using the below code: import requests from zipfile import ZipFile from io import BytesIO import pandas as pd z = 'www.someur