Category "python"

How to find correct "json" parameters on Request POST?

I am new to webscrapping and am trying to access an employee database on a website. To do this, I noticed that when I hit the search field the site sends a requ

APC PDU CLI automation over SSH

I found this script on Github for managing APC PDU from CLI, but it's using Telnet to login to APC PDU. What I'd like to do is change Telnet to SSH, but it does

How to find minimum of some variable with repeating row indexes and preserve all other variables in Python Pandas

Basically, I have multiple repeating dates and the indices (1/2/1990 many times followed by 1/3/1990 many more times, etc.) I want to find the minimum of a give

Why cv2.write saves black images?

hi folks, greetings am using this code that I found on the web, to apply a wiener filter on an image, the code : from scipy.signal.signaltools import deconvolve

searching in range between columns using sqlite3 in pandas

I have found solution to my problem in one question Merge pandas dataframes where one value is between two others I tried to modify it for my situation but it d

bat file in Windows scheduler not running python script

I am trying run a python script to update a ppt presentation. I have also tried this a year ago with running a regression and updating a table in SQL and didn't

Pythonic way of checking if a condition holds for any element of a list

I have a list in Python, and I want to check if any elements are negative. Specman has the has() method for lists which does: x: list of uint; if (x.has(it &l

How to get image from bytes in Python?

I have an image (jpeg). I get the bytes from it simply using open('img.jpg', 'rb'). And for instance I send that bytes to my friend. So which way using Python c

Return Value from Function is None

Hello So i created a function to see if every character of a string is valid to be changed from base 10 to base 2(binary for example) but i dont know why everyt

Making a plot that has an x-axis that has neg. values representing hours prior to the start of the event, then pos. values representing hours after

I'm not sure if my question makes sense, so apologies on that. Basically, I am plotting some data that is ~100 hours long. On the x-axis, I want to make it so t

Mfcc classification: in sklearn how could I solve the dimension error of y

prediction_class = labelencoder.inverse_transform(predicted_label) prediction_class ValueError: y should be a 1d array, got an array of shape (1, 10) instead. p

Telethon (bot), how to work with commands, buttons and anwers

I want to implement something like BotFather. It sends buttons and you select your option, and if the option need a answer you must answer with the correct answ

ValueError: Excel file format cannot be determined, you must specify an engine manually

I'm trying to convert multiples files in a diretory to CSV format; I did this code, and ran it in 3 folders. But that one i get this error i found something li

Why does the function only add the last object?

Why does the function only return the last object from the request? And does not add a new one to the Data dictionary? def holdings(): data = {} res = r

Iterate trough a converted datetime pandas dataframe with a external function

https://rhodesmill.org/skyfield/positions.html#azimuth-and-altitude-from-a-geographic-position Hi I have function that generates a sun-shot azimuth on a specifi

O365-Rest-Python-Client - Struggling to get the displayname mapped

I am trying to convert a sharepoint list to a pandas dataframe. The Internal name is being returned by default I believe by the client, which isnt very useful

java.lang.NoClassDefFoundError: org/apache/hadoop/hive/ql/metadata/HiveException while running DAG in Airflow

I am running a python project through DAG in airflow, and I encounter the following exception when the dag runs this line from the project - df = spark.sql(quer

Pycharm pytest run configuration - how to remove redundant argument

Every time I'm trying to run Pytest with debugger - unexpected "-k" argument is passing automatically and this causes run error. I can't find this argument anyw

Cant send discord button

I get no errors or anything. Using newest version of discord.py v2. @client.command(aliases = ["Rock Paper Scissors", "RPS", "Rockpaperscissors", "rockpaperscis

how to access a specific data in two columns using if and statement

My Data Frame My Code: a = 10001 b = "01.01.2001" if a == np.any(df["Token_ID"]) and b == np.any(df["Date_of_birth"]): print("yes") else: print("no")