Category "python"

Having Issues Loading the CelebA dataset on Google Colab Using Pytorch

I need to load the CelebA dataset for a Python (Pytorch) implementation of the following paper: https://arxiv.org/pdf/1908.10578.pdf The original code for loadi

Tensorflow dataset element shuffle within specified range

How do I shuffle the elements of tf.data.Dataset within a certain range. Having an input array, with shape = (10,), in the first 5 elements would be shuffled wi

sqlalchemy.exc.NoSuchModuleError: Can't load plugin: sqlalchemy.dialects:postgres

I'm trying to connect to a Postgres database with SQLAlchemy. I've installed psycopg2. However, I get the error sqlalchemy.exc.NoSuchModuleError: Can't load plu

SQLAlchemy: Using sessionmaker as contextmanger forces to expunge manually

I'm using SQLAlchemy and trying to use the sessionmaker as a context manager for my transaction (following the documentation): Session = sessionmaker(some_engin

No dependencies have been added to tensorflow.python.keras.engine.functional.Functional object

I was trying to load the checkpoints weights to the trained model and got the following error message. Any idea how to solve it? File "/src/trainer/loaders.

How to remove 2d array from 3d array if it contains NA values

I am working on a seq2seq machine learning problem with Conv1D and LSTM, to do this I must produce a tensor input of the shape samples, timesteps, features. Asi

File Path Details | Using command prompt or any script

Can anybody help me with some command prompt details/ script detail/python programming on how to get file details? Scenario: Folder contains many subfolders --

Import "selenium" could not be resolved Pylance (reportMissingImports)

I am editing a file in VS code. VS code gives the following error: Import "selenium" could not be resolved Pylance (reportMissingImports). This is the code from

I'm having trouble with pasting a gif on an image using PIL

from PIL import Image, ImageSequence import PIL GIF_PATH = Image.open(r"C:\Users\me_\My\Filw\Path.gif") IMAGE_PATH = Image.open(r"base.png") frames = [] for fr

Dynamic bin per row in a dataset in Pandas

I am having trouble dynamically binning my dataset for further calculation. My goal is to have specific bin/labels for each individual row in my dataframe, base

WebScraping using Python & Azure : How to run an Azure Function to store pandas dataframe into a CosmoDB?

My porpouse is to automate the aquisition of data from a website. I have my python scripts to scrape tables and i can store it as a dataframe or in a csv,xlsx f

How can I fix this error installing web3 on Python

ERROR: Command errored out with exit status 1: command: 'C:\Program Files\Python39\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0]

How do I clear the cache from @cached_property decorator?

I have an function called "value" that makes heavy calculation... The result of the function is always the same if the dataset is not changed for the identifier

How to pass custom weights to scikit_learn wrappers (e.g. KerasClassifier) in a multilabel classification problem

I'm building a chain classifier for a multiclass problem that uses Keras binary Classifier model in a chain. I have 17 labels as classification target and datas

Formating a string to keep the wanted

I have an issue with this code: from netmiko import ConnectHandler from re import search lsite=[] try: NetworkDevice = { "host" : "ip", "u

Python Discord Bot reproduce audio from youtube link

I'm trying to make my discord bot reporoduce audio from a link @client.command() async def play(ctx, url): #...code but it seems that I need to have install

Using backspace across multiple tkinter Entry widgets

I made wordle (using tkinter) in a previous project of mine, and now instead of using one entry to get the guess, I want 5 entries linked together that work lik

Image blending: transparant black areas

I'm trying to add a chessboard to an image in order to find the distortion coefficients. However when I use the function addWeighted() the black areas of my che

ERROR: Could not build wheels for hyperscan, which is required to install pyproject.toml-based projects

Error while installing hyperscan on windows. Tried updated PIP and installed wheel but still no luck. ERROR: Could not build wheels for hyperscan, which is requ

Python Input string into an integer value

I'm programming a chemistry calculator that takes the element name and turns it into the value of its charge. So hydrogen is equal to 1 but I want to ask for th