October 22, 2024
Chicago 12, Melborne City, USA
python

Error while trying to use the picam2 library: module 'kms' has no attribute 'PixelFormat'

I have been facing an issue. I have a project, where I have to use facial recognition from insightface to detect know people. Hardware-wise, I have been given a Raspberry pi 5 and two picams (v1.3, v2.1). I found out that there is an issue with the picam 2 not being detected by the system

Read More
python

Improving runtime of graph computation

I am using pycel to create a graph of an excel calculation. Essentially I have a cell that performs some calculation: E.g., =AVERAGE(I2:X2) Which in turn is a function of other cells in other worksheets E.g., I2 = sheet2!A1/sheet3!B6 And these cells can be functions of other cells etc. pycel builds a graph of this

Read More
python

Iterate data pandas between two tables

I’m trying to add a new column to my customers table (table). This new column is the sum of pending orders for a product (SKU). Pending orders are in another table (tableOV). I managed to do this, but it is taking a long time to calculate. I would like to know if there is a

Read More
python

How to stop auto generating text in ShortUUIDField field

I have a model where ShortUUIDField automatically generating ids I want to disable the auto generation class Mymodel(models.Model): pid=ShortUUIDField(length=10,max_length=100,prefix="prd",alphabet="abcdef") sample_id = ShortUUIDField(length=10, max_length=100, prefix="var", alphabet="abcdef", null=True, blank=True,default=lambda: None) I added default=lambda: None in sample_id field but it is still automatically generating the ids. I want the id default to be blank You need to sign

Read More
python

Mininet bandwidth not updating dynamically via HTTP request in Flask API

I am simulating a custom network topology using Mininet and controlling bandwidth dynamically through a Flask API. The setup involves a server, a router, and two clients. I’m using TCLink in Mininet for bandwidth control and using tc (traffic control) to limit bandwidth per client dynamically. The code works well initially, and the Flask API

Read More
python

Scanned document forgery detection

I am supposed to start working on a project involving detecting forgeries on pdfs representing document scans (payslips, receipts,…), these documents were forged before being scanned. To be honest, I am a bit lost regarding the approach I should use as I am a beginner on computer vision. I suppose I can’t really use methods

Read More
python

How to auto deploy AWS lambda functions to multiple aws accounts

I am working on AWS lambda functions using python and SAM deployment.Already i am deploying in one account with two environments. If i need to deploy it to multiple AWS accounts, then how to auto deploy all lambdas to those both accounts and how to manage table names and api in the lambda? I have

Read More
python

My div diplays for a second and then disappears

I have this html page that receives html elements got from javascript as shown in the code below. I aim to display the information in a div called ‘results’. It displays for a second, and then it disappears as if it’s being replaced suddenly. Why is this happening? How do I fix it? const form

Read More
python

pd.to_datetime fails with old dates

I have a csv file with very old dates, and pd.to_datetime fails. It works in polars. Is this an inherent limitation in pandas, a bug or something else? import pandas as pd dates = ["12/31/1672","12/31/1677","10/19/2024"] df = pd.DataFrame(dates, columns=['Date']) df['Date'] = pd.to_datetime(df['Date'], format="%m/%d/%Y", errors="coerce") df Date 0 NaT 1 1677-12-31 2 2024-10-19 in polars import

Read More
python

Does Plotly has troubles plotting images when the x-axis is in date format?

I have been trying to plot an image as a marker in a plotly graph and haven’t been able to achieve this successfully. If I plot the image using integers for x axis everything seems to work fine: fig = go.Figure() pyLogo = Image.open(sell_icon_path) # Add trace fig.add_trace( go.Scatter(x=[0, 0.5, 1, 2, 2.2], y=[1.23, 2.5,

Read More