Category "python-3.x"

TypeError when querying dataframe with field condition

I am trying to make the following query: df7[df7['bath'] > 10] But I am getting the following error: TypeError: '>' not supported between instances of 'me

Is there a way to embed python turtle script in flask?

I am making a website with flask framework as a simple project, and I'm wondering if there is a way to embed a python turtle script, I know I can use the jinja

while data == 1 run action one time

From an api, I receive a data. It returns two values: 1 and -1. I receive one data per second and in series of 1 or -1. What I want is that when data goes to 1

Jenkins - Continuous deployment for (non-stop running) single-file python application

I have made a simple telegram bot in Python. All code is in one .py file. Trying to achieve "continues deployment" I installed Jenkins, and with the GitHub plug

How can I convert a PureWindowsPath to a Iterable?

I'm working on an academy project to encrypt some files I have managed to encrypt all files from one folder but when there is a folder into that folder i get er

How can I add legend while plotting multiple geopandas dataframes in the same subplot using matplotlib in Python?

I have a geopandas dataframe world which I created using: import geopandas as gpd world = gpd.read_file(gpd.datasets.get_path('naturalearth_lowres')) I create

Simplifying an 'if' statement with bool()?

I am a beginner python user. how would I shorten this? my pylint was complaining. def eat_ghost(power_pellet_active, touching_ghost): if power_pellet_active

How can I fix this error in my avatar command that I'm getting?

I need to fix this error, I'm not very good with APIs. I am keen to understand how to fix it, since I'm trying to learn Python. The code: @client.command() asyn

Get Last Failure and Last Success time jenkinsAPI

CLICK HERE TO SHOW THE IMAGE I want to get these marked time of last success and last failure (present in image) using python code by jenkinsAPI HERE IS THE COD

Ensure a class always uses its own version of a method rather than the one defined in a subclass?

I have this code: class A: def __init__(self, vals: list): self._vals = vals def __len__(self) -> int: # some side effects like logg

Import a python property in other file python

py like this class MyStack(core.Stack): def __init__(self, scope: cdk.Construct, construct_id: str, **kwargs) -> None: super().__init__(scope, c

QCombobox throwing unrequested value via connection method in python

QComboBox is connected to a function using following syntax: self.combobox_releases_x_drive.currentTextChanged.connect(self.refresh_subfolders) Python method lo

Can't get widgets to line up properly in GTK3 and Python3

I've written a GUI to set the sensitivity for the trackpoint on my Thinkpad. It's written in Python3 and GTK3, and the widgets for adjustments are laid out on a

tkinter.messagebox doesn't retrigger in my while loop

I'm a beginner programmer and I'm trying to write some code that would show a messagebox whenever my battery level gets to either 1% or 100%. With the code belo

How to emulate clicking on coordinates on android in the editor on android python

On my device there is a safe from which I forgot the password and I want to sort through all the passwords through auto-clicking on python. The problem is that

Merging excel workbooks into one using xlwings

I am currently trying to merge a number of excel spreadsheets into one workbook to create a monthly master workbook. I have written the following code to try an

Can I return a single backslash in a JSON response in FastAPI? [duplicate]

Seems like a really simple question and it's not clear what the correct answer is here. We understand that backslashes are a special delimiter

Remove empty elements from nested JSON

I have a nested json with an arbitrary depth level : json_list = [ { 'class': 'Year 1', 'room': 'Yellow', 'students': [

Python3 unicode strings with pyobjc

I'm converting a lot of python2 scripts that use pyobjc to python3, and having trouble getting them to work. The problem seems to relate to the Unicode changes

Python chat server with selectable specific user to chat

I am trying to write simple chat based desktop support app. The gui is not problem, but I have problem with sending messages. The server sends it to all connect