Category "python"

Converting Images to ASCII art using Python & Python Imaging Library

I'm currently trying to write a program that converts images into ASCII art in Python using Python Image Library Here's what I got so far: import PIL.Image # a

"ValueError: 'image_path \tpredicted_labels \tconfidence score' is not in list"

Getting this error when I run the following code in google colab "ValueError: 'image_path \tpredicted_labels \tconfidence score' is not in

How can I group by below table from Customer ID and Product Code and get them to one row?

How can I group by below table from Customer ID and Product Code and get them to one row as below using Python? Customer ID Product Code Days since the last

Python 3.10 Type Hinting causes Syntax Error

I have defined two classes. A Bookshelf class and a Book class and have defined each with its own methods and type hints. When I run the below code in VS Code u

Call Python file with main method inside Jupyter notebook

I have a problem. I want to call inside my Jupyter Notebook a Python File. I looked at How to execute a * .PY file from a * .IPYNB file on the Jupyter notebook?

Python - Division by zero

how can i make something divided by 0 equal base, EX: 5/0 output 5 Sorry I can't explain properly, I'm new to programming

Python OpenCV putText() show (non-ascii, unicode, utf) character symbols

I am creating a sign language detection application in Armenian. However, the Armenian letters don't show when I am signing but do show in my console/terminal.

Plot points in google map with python with google api

I'm trying to plot some points on a map, and when searching on the internet, I found [this][1] tutorial with Google Maps and Bokeh library. The problem is that,

Unable to install turtle module

Collecting turtle Using cached turtle-0.0.2.tar.gz (11 kB) Preparing metadata (setup.py) ... error error: subprocess-exited-with-error × python

Crashing Jupyter Notebook

enter image description here enter image description here enter image description here enter image description here enter image description here enter image des

extract emotions from text in dataframe in senticnet

I am very novice in python and I treat to extract emotions from sentence in datafram though senticNet this my code but its not correct I don't know what's the

Transportation Problem : how to addresing variable from range(len()) for constraint? (transitioning from excel)

I'm new on using phyton for optimization (usually I simple use Ms.Excel) and this is my first time asking on stackoverflow. Usually in Ms. Excel you can add con

PyPDF2.extractText( ) extracts text but tokenizes strings when pdfs contain watermark

I am using PyPDF2 to read multiple files and extract the page number that contain specific text. For the most part it works fine but I notice that some files wi

Get rid of single quotes from the substituted string within sed command in Python

I have a text file 1.txt which has following content: module abc I am trying to generate multi-line string that I need to add before module abc line in 1.txt.

Keras model prediction after tensorflow federated learning

I am working with TensorFlow Federated framework and designed a keras model for a binary classification problem. I defined the iterative process with tff.learni

Apply a transformation model (data augmentation) in images in Tensorflow

I am a newbie in some sequential models in Tensorflow with Python. I have a transformation sequential model like the one below. It applies randomly to a given i

How to assign a database model to a user

from django.db import models from datetime import datetime from django.contrib.auth.models import User class News(models.Model): user

ValueError: Unable to find resource t64.exe in package pip._vendor.distlib

i am trying to run tox commands but it shows error ValueError: Unable to find resource t64.exe in package pip._vendor.distlib ERROR: python3.7: could not inst

pandas - repalce a key's value of a dictionary column with another column

In pandas, I have 2 columns, one of which is a dictionary and the other is a numerical column. When the dictionary column is not null, is there a time efficient

Removing values from an 2d array

I have a 2 dimensional numpy array and want to remove all 'false' values. A nested array with different lengths should be created. [['false' 'value1' 'false' 'f