Category "python"

How to embed a digital signature and a digital certificate (.crt file) to a pdf document with python?

how do I embed/add a digital signature (base64 string) and a digital certificate file .crt to a pdf document with python? Is it possible? What lib/packages allo

How do I call a function for any unhandled exception in my Flask app?

I have a Flask app that I am using to create some API endpoints (using flask-restful) for interacting with an app I am developing. I have built a function error

XPATH issue while looping through tags

I have this piece of code, where I try to download these papers but the loop prints the first element only. import scrapy from urllib.parse import urljoin class

How to append row value to the other column

I have a table that includes two columns: P_SEG SEG_ID 1 [2, 4] 2 [4, 3,5] I want to create a new column that includes the 1st column value in the second colu

Way to change value based on condition with previous validated data?

I cannot manage to implement in an efficient way a method that could change values in dataframes based on difference with previous "validated" data. I have a da

I got an error with websocket and json (Discord Gateway)

when i finished the code there was MULTIPLE ERRORS and i was personally confused. import os import websocket #pip install websocket-client import json import ti

How to preform loc with one condition that include two columns

I have df with two columns A and B both of them are columns with string values. Example: df_1 = pd.DataFrame(data={ "A":['a','b','c'], "B":['a x d','z y

Python- How to Combine 2 pandas.core.frame =.dataframe with the same column name together in python [duplicate]

So i got 2 pandas.core.frame.DataFrame like this: anomalies: Sales outlet Date 2006-07-01 700 2 a

Split Datasets per labels

I want to split some datasets such as CIFAR10 or MNIST in a non-iid way: basically I am doing Federated Learning experiments, in which I want that each client h

Unable to select an item from TreeView using Pywinauto

I am automating a desktop application. I need to select an application from a tree view. Class name is TreeView20WndClass. app = Application().connect(path=r"pa

How to record depth stream from realsense L515

I have a depth camera (Intel Realsense L515) and I do like to record a video of the depth. I have seen this answer which is using FFMPEG, but I didn't know how

Trying to get the minimum date and getting TypeError: '<' not supported between instances of 'datetime.datetime' and 'int'

i'm reading from an excel file GA = pd.read_excel("file.xlsx", sheet_name=0, engine= "openpyxl") The data type is: Email object Date datetime64[ns] Name object

Is it possible to do a list comprehension of a list of dictionaries? [duplicate]

If anyone knows how to do a list comprehension of this, please do let me know!~ Right now I am trying to extract only the IDs into a list. The

Understanding bitwise NOT in python

I was trying to understand bitwise NOT in python. I tried following: print('{:b}'.format(~ 0b0101)) print(~ 0b0101) The output is -110 -6 I tried to understa

Open3D scene renderer render_to_image returns black screen

I am trying to render a scene that simply contains a mesh of obj file and the material file. It looks okay when I try to view with o3d.visualization.draw([{

How to convert PPM image file to JPG or PNG using Python? [duplicate]

I have made a script which makes a valid ppm file which when opened using a ppm viewer is working properly. But I don't want my users to insta

sum of a int in a list excluding the " " python

I have a list like this lst = [12, 0, 13, ' ', 8, ' ', 13, 4, 4, 3, ' ', 0, ' ', 19, 0, 23, 8, ' ', 20, 15, ' ', 19, 14, ' ', 20, 1, 20, 3] and what I am looki

odom and base_link frames are far - localization

I have an imu and gps only and i want use them for localization. I am using robot_localization ekf node. its setting is similar to this. when I view the tf on r

Truncate a long string in python - but only after specific character

I use textwrap to split a long string into chunks, limited to 280 characters each. I don't want the split to occur at random though; it should only occur after

Bypassing Imperva bot detection with Scrapy. Any way possible?

I'm trying to scrape several links containing information about events. I am rotating my paid proxies and user agents generated by UserAgent library. Imperva, w