Category "python-3.x"

TypeError: 'ZipFile' object is not callable

I am trying to save the new cropped brain tumor images into the subfolders of TRAIN_CROP, TEST_CROP, and VAL_CROP in the main folder of TRAIN, TEST, and VAL. x

Pygame: AttributeError: 'pygame.Surface' object has no attribute 'display'

Code: import pygame, sys, os from pygame.locals import * red = (255,0,0) pygame.init() window = pygame.display.set_mode((1000,600)) pygame.display.set_caption

AttributeError: Could not locate column in row for column '_sa_instance_state' Flask-sqlAlchemy

im developing a new project, im building a small CRM web app using Flask. Im very new using this technology. Im getting this error: AttributeError: Could not lo

How to divide two aggreate sum dataframe

I want to divide the sum of two columns in pyspark. For example, I have a datasets like below: A B C 1 1 2 3 2 1 2 3 3 1 2 3 What I want is t

Getting a bunch of error messages when trying to install Truffle. How do I fix this?

I am using Windows 11 and Windows PowerShell to write the commands. Right now its a struggle to just install Truffle :/ I've tried restarting the computer, inst

Glue 3.0 has Psycopg2 but "No module named 'psycopg2._psycopg'"?

I'm using AWS Glue 3.0 and am trying to connect to Redshift using Psycopg2. At first I was uploading a whl file version of it and it would give me the error abo

How can I create a tarball with UID/GID of root?

I'm trying to amend this code so that the UID and GID of the files inserted into the tarball belong to root. import tarball sources = [ 'test-directory', 'ano

Thales HSM Import Public Key (EO) error '04'

I am sending this command with a DER encoded public RSA key. 1234EO013082010a02820101ec7b6d6be7d0603e3f247c22dd0ae533f02f1216fd9099d6ec5c596eb92c95e8ee87e3437af

Comparing 2 columns with different rows in different csv files, and output status to another csv file

I have 2 csv files as shown below. They contain different numbers of rows and the columns are not aligned/sorted along a common index. I need to compare the col

Python3 merge tuples in a list and remove duplicates

There might be a similar ask to this one in the past, however wasn't able to find the one that I was looking for, Input = [('Icecream', 'Vanilla'), ('Icecream'

typeerror 'nonetype' object is not callable selenium

Code: from selenium import webdriver from bs4 import BeautifulSoup driver=webdriver.Chrome('H:\datascience-python\selinium\chromedriver.exe') driver.get('htt

How to update multiple Lambda functions from python 2.7 to 3.6

I have approximately 13 Lambda functions with triggers on python 2.7 runtime environments. I need to update to 3.6 What is the most efficient way to do this? Do

why the feedparser break without any error message when pull rss channel in Python 3

I am using feedparser feedparser=6.0.2 to parse some rss resource in Python 3.10, when I using feedparser to get the response in the CentOS 7.x, the feedparser

django-import-export error while importing data into database

Here's the SS of import error And this is the SS of CSV file Line number: 1 - 'id' Traceback (most recent call last): File "/home/carlmark/Desktop

Could not install ChatterBot. Raises errors [duplicate]

i tried to install chatterbot but i got the following error I tried downgrading to chatterbot==1.0.5 still it raises errors Gives errors while

PyQt - Oriented Flow Layout

I'm trying to adapt this PyQt implementation of FlowLayout to allow vertical flow as well as horizontal. This is my current implementation: from PyQt5.QtWidget

Detect all names and get their link with Selenium Python

I want to make a search system when we enter a word in a variable, it search between all links’ names of this page (all the games) a little like a «

How to capitalize the First letter of each word in python?

You are asked to ensure that the first and last names of people begin with a capital letter in their passports. For example, alison heck should be capitalised c

How to put a Graph into a Screen(Manager) with kivy

I have 3 Screens in my kivy application and in the second screen i want to put a graph which is a widget. I have my own class for this graph. The goal is do dis

Numpy where function in python

I have a data frame like this: pd.DataFrame({'Material': ['Steel (16MnCr5)', 'X', 'X', 'X', 'Carbon black', 'Sulfur', 'Copper'], 'Weight': [4, 8, 0, 8, 6, 9, 3