Category "python"

flow control - automate the boring stuff (is it raining)

I have looked at this so many times and confused myself. Looking at the flow chart: I am getting confused on how to do the loop on the right hand side. This ho

MongoDB python connection

I just upgraded my mongoDB subscription and suddenly I get this error everytime I try to connect: -shard-00-02.dlu0y.mongodb.net:27017: [SSL: CERTIFICATE_VERIFY

Python: Should I save PyPi packages offline as a backup?

My Python projects heavily depends on PyPi packages. I want to make sure that: in any time in the future: the packages required by my apps will always be availa

XGBoost model quantization - Sklearn model quantization

I am looking for solutions to quantize sklearn models. I am specifically looking for XGBoost models. I did find solutions to quantize pytorch and tensorflow mod

Real-time pipeline for processing data, insert into PSQL

I have files that will be coming in daily that I would like to process as they come in and insert into existing sql tables (using postgres). What is the best wa

how to open a jupyter notebook under a folder in google drive?

I am trying to open a existing jupyter notebook from a folder in google drive. In colab, I do: File-> open notbook-> google drive Only jupyter notebook fi

copy/clone of keras subclassed models with custom attributes

I have a subclassed model with some custom attributes like this: class MyModel(tf.keras.Model): def __init__(self, *args, my_var, **kwargs): super()

decreasing values with loop in Django

in this code, I tried to decrease the quantity of products from the database when the user places the order, it is working but the problem is just decreasing fr

Python Plotting multiple graphs for a function with 3 different parameters - of different values of each parameters while fixing the 2 others -

Could you please check my code and tell me why it's not working: def plotSabrImplVolSmile (security, context, expiry, N, lstalpha, lstvov, lstrho): strikesG

Apply ta_py function to Cudf dataframe - RAPIDS

trying to create a new column on a cudf dataframe based on VWMA from ta_py : #creating df CJ_m30 = cudf.read_csv("/media/f333a/Data/CJ_m30.csv",

complex UPDATE query in psycopg2

I've stumbled upon an interesting problem while trying to compose an SQL query using psycopg2.sql I have a function that takes in some kind of data in a dict fo

Iterating through list of lists of lists

I am trying to iterate through a 3-D list in python(not numpy but I am willing to convert to a numpy array if this makes it easier) in such a way that from a li

Pandas+Uncertainties producing AttributeError: type object 'dtype' has no attribute 'kind'

I want to use Pandas + Uncertainties. I am getting a strange error, below a MWE: from uncertainties import ufloat import pandas number_with_uncertainty = ufloa

How to change array rows places whithouth numpy

Hello everyone here is my code: n =[[34,2,55,24,22],[31,22,4,7,333],[87,74,44,12,48]] for r in n: for c in r: print(c,end = " ") print() sums=[]

Tell me why my telegram bot stops working after some time and gives an error:

The bot works for 10-30 minutes, then with any command in the telegram bot, the following error appears in the code terminal: Traceback (most recent call last):

I'm using kivymd and i get this error when I try to import MDDatePicker from kivymd.uix.picker

Even though I have already installed kivy and kivymd from kivymd.uix.picker import MDDatePicker here's the error I get : In the near future the `FitImage` wi

OSError: You seem to have cloned a repository without having git-lfs installed. Please install git-lfs and run git lfs install followed by git lfs pul

I'm using Jupyter Labs on AWS SageMaker. Kernel: conda_pytorch_p36 and did Restart & Run All. I git cloned this repo. Attempt at installing git-lfs: !curl -

How can I indented in multiple with statement in Simpy?

I tried to build a simpy model with multiple 'with' statement as below. However, based on indentation, the result was different. Please let me know what is the

How to install wordcloud for python?

I am trying to visualise data using word cloud. However when I used pip install wordcloud, I got the following error: D:\...>pip install wordcloud Collecting

How to test multiple variables for equality against a single value?

I'm trying to make a function that will compare multiple variables to an integer and output a string of three letters. I was wondering if there was a way to tra