Category "python"

using argparse, getting KeyError

import argparse import imutils import cv2 as cv ap = argparse.ArgumentParser() ap.add_argument("-i", "--input image", required=True, help='Input the Image') a

Read images from url and put them on a dataframe column with the label to another column in python

I would like to read images from url and place them on a pandas dataframe column and place label to another another column. How can I do that please help. Below

Raise an error when a key is duplicated in a dictionary

I've created a code that reads in a text file and converts the lines to a dictionary. How do I raise an error if there is more than one key with the same value?

Python - Keras : Merge two models into one sequential

How do create one model sequential with two models? I have two models, one a Keras application (vgg16 model) and a custom model and I would like to merge them i

how to send information(data) from a FastAPI server(client) to another FastAPI(model)

I am a newbie in RESTful API... so I am trying to deploy two servers (client and model). The main idea is : Client uploads his images on the client server, the

Nested list creation from a single list with given range [duplicate]

I have a list li = [1,2,3,4,5,6,7,8,9] How do I form a nested list for a given range? lets say if the range is 3 I want the output as [[1,2,3]

Why is lambda not working property 'value'?

this df2['CLINE_TYPE']: Increase_FALSE Decrease Increase_FALSE Increase_SUPERPOSITION Decrease_FALSE Increase Increase_SUPERPOSITION Decrease_FALSE Increase Inc

Word2Vec + CNN Overfitting

Currently I'am training my Word2Vec + CNN for Twitter sentiment analysis about COVID-19 vaccine domain. I used the pre-trained GoogleNewsVectorNegative300 word

Why doesn't text fit in rectangle drawn

I created a rectangle using Zelle graphics.py and wrote text of 10 points into many lines down the long narrow rectangle. Words fit from the left to right side

What would be the equivalent code of following google finance query in python?

I'm trying to fetch weekly EOD data in python using yfinance module. I wanna use the same format of the excel code given below. gives me weekly closes (Friday)

ModuleNotFoundError: No module names 'pddlstream'

So I know this question has been asked a lot, but I am seriously stuck and cannot work it out. Sorry, I am still learning relative imports. So my file tree look

How can I get all posts id from any wordpress website using Beatifulsoup?

I am trying to figure out how to scrape post IDs from any wordrpess website using beautifulsoup. soup = BeautifulSoup(html_doc, "html.parser") article = soup.f

How to install Pygame in PyCharm with error "no such option: --build-dir" [closed]

I have created a PyCharm project, updated pip to 22.0.4 and updated setuptools to 62.0.0 (both the latest versions). When I go to the project

Connecting to a remote FTP server from Docker container running within remote Linux server

The goal of my project is to be able to schedule run a program from a linux server which connects to a remote (existing) ftp server and transfers from files fro

First occurrence of a specific value in a row (prepping for survival analysis) - python

I have the following data (see attached - easier this way). I am trying to find the first occurrence of the value 0 for each customer ID. Then, I plan to use c

Find nth occurrence of a character in a row and replace it in Python, in order to fix/replace a wrong/leftover ";" separator in a text file

I would like to import a text file, with 14 columns with the symbol ";" as a column separator. So, if we have 14 columns, it means we'll find 13 ";" separators

How to make a custom 404 page?

I am making a rick roll site for Discord and I would like to redirect to the rick roll page on 404 response status codes. I've tried the following, but didn't w

How to count values between a date time and make a new column out of it

In Python Pandas I need to create a new column in a dataframe (number of encounters in last year) in the below dataframe with the following logic. I want to cou

read wav file occur UnicodeDecodeError

import os import tensorflow as tf import tensorflow_io as tfio from matplotlib import pyplot as plt CAPUCHIN_FILE=os.path.join('data','Parsed_Capuchinbird_C

Trying to set up flask with nginx and gunicorn

I have followed a simple guide, and trying to show my flask application, but it wont show. I am running everything through ssh on a ubuntu server. Have my flask