Category "python"

'more placeholders than values' when inserting into sqlite database

I am trying to dynamically insert into a sqlite database from python. Here is my code: for person in people: db.execute("INSERT INTO students (first, middle, la

How can I get file access in JupyterLab running over the web, which is giving me many errors?

Update: I conclude from discussions with others that this is a genuine bug; the web versions of JupyterLab do not currently allow you to access files. When I ru

How to subtract 1 dimension Numpy arrays with different shapes and plot the difference in seaborn or matplotlib? [duplicate]

Basically I have these arrays print(img_arr[0].shape)->(returns) (122218,) print(img_arr1[0].shape)->(returns) (125204,) so when I did

Error [WinError 10054] when sending email TO gmail.com via smtplib from my VPS (other domains are ok)

I'm struggling for few days on this problem : i can't send a mail to a gmail address (other domains such outlook or my own etc. are ok). My domain is hosted on

Any idea why I would get "name 'sys' is not defined" after creating a new MongoClient object in Python?

I'm working on a Discord bot that saves some data to a mongodb database in response to some user commands. The weird thing is it works on repl.it, but I get thi

pause and resume http file upload/download

I have 2 servers, one local server(office) another remote server in cloud (storage), users in the office can't access the remote server. I want to create some u

sklearn.model_selection.train_test_split random state

I am training a computer vision model. I divide the images in 3 datasets: training, validation and testing. So that I get always the same images in training, va

PyMongo Atlas Search not returning anything

I'm trying to do a full text search using Atlas for MongoDB. I'm doing this through the PyMongo driver in Python. I'm using the aggregate pipeline, and doing a

using IF condition in polars.dataframe

this is an example of my code. im trying find a specific row using IF condition for example, ┌────────^

Python Spyder- Horizontal scrollbar in IPython console hiding the last line

When the Spyder console has displayed output too wide to view, it adds a horizontal scroll bar to the bottom. This scrollbar hides the last command line of the

IntegrityError NOT NULL constraint failed: even though I have already overriden the form_valid?

So I'm trying to create a simple Comment feature for a blog app. In the Class-based views, if you are using a Foreign Key in your model, I know that you have to

Python: Iterate through YAML file and output all relevant settings from hierarchy

I'm new to python and am looking for the best way to import a YAML file into Python and iterate through it to collect relevant appsettings for a specific instan

How to get the actual learning rate in PyTorch?

I'm trying to find the appropriate learning rate for my Neural Network using PyTorch. I've implemented the torch.optim.lr_scheduler.CyclicLR to get the learning

opencv face detection problems

Please help me resolve this **openCv **problem in faces import cv2, time first_frame = None video = cv2.VideoCapture(0) while True: check, frame=video.read(

Non Linear Decision boundary SVM

I need you guys help to find a non linear decision boundary. I have 2 features with numerical data, I made a simple linear decision boundary (see picture below)

How to make a discord bot generate invite links from other servers, (Discord.py or py-cord)

I am making a discord bot in discord.py, py-cord, and I was wondering if it's possible to have the bot generate a discord invite for a server and send it to you

ValueError: time data 'datetime' does not match format '%d/%m/%Y'

import csv with open('./scrubbed.csv', 'r') as f: reader = csv.reader(f) for row in reader: new_date =dt.datetime.strptime(row[0], '%d/%m/%Y') format_d

ValueError: Could not find a backend to open '10.jpeg` with iomode `ri`

I am new to MaskRCNN. I have added 15 images to the dataset/train folder however, while running the code I am getting error for the line image = skimage.io.imre

zipfile and shutil not keeping the file exif data

I have a .zip archive and within it a single .dng image file with metadata about exposure time, etc. When unpacking this achive using either shutil.unpack_archi

Inequality not supported between instances of 'str' and 'int'

So I basically made a algorithm which takes the users input and decided on a rank from 1-100 and puts it on a UI. THe problem here is the find function and when