Category "python"

Can not run pyinstaller, as I get enum34 error

I finished a python app, and now I want to packing into an executable, for an end user. I use windows 7 64 bit, and my python version it's Python 3.7.2 I alread

Problem by using for loop when loading data series from .csv file and save them as array matrix for every columns loaded

I want to load a series of data from 6 CSV files and save them per column of the data series. As I call the Column_A, Column_B and new_Column_A, only the last o

neither find_all nor find works

I am trying to scrape the name of every favorites on the page of a user of our choice. but with this code I get the error "ResultSet object has no attribute 'fi

saving s2p format for vector network analyzer vna by jupyter notebook

I connected my laptop to a Vector Network Analyzer (VNA) by a GPIB cable. I identified the instrument to the laptop by the following code in Jupyter Notebook: f

Library that supports XPath 2.0 in Python

Is it possible to use XPath 2.0 functions like starts-with(), ends-with() and contains() in Python? I was trying to use lxml and defusedxml, but unfortunately t

Return sub list of elements based on matching sub strings from another list

I want to filter a list of string based on another list of sub strings. main_list=['London','England','Japan','China','Netherland'] sub_list=['don','land'] I w

can't import torchtext.legacy.data

as i know, from torchtext 0.9.0, torchtext.data and torchtext.dataset are moved to torchtext.legacy but my 0.12.0 torchtext can't import torchtext.legacy while

Remove zeros from Dataframe of lists

I have such a DataFrame: index B 0 [0,1,2,0,4] 1 [1,0,2,0,0,1,7] I want to count the non zero values of each list for each row. Result: index B 0 3 1 4

data format to predict with model fitted via Sagemaker's XGBoost built-in algorithm and training container

Looking at the following code, taken from here, I wonder what format dtest is (sorry I could not gleen this from the post): import pickle as pkl import tarfile

extracting holder exponents and singularity spectrum from signal in python

Is there any way of computing the holder exponents and singularity spectrum of a signal using multifractal 1-D wavelet leader estimates? Matlab has dwtleader: h

AttributeError: 'list' object has no attribute 'i_sd'Which function can be used to get values from a Callback Class

The callback is called when specific events occur in an environment (e.g. at the beginning/end of a reset and beginning/end of a step). I have written a stub of

How to save SHA256 object to a file?

(I'm doing all this in python 3.10.4 using pycryptodome) I'm trying to do this process: Get a hash of a file Save that hash somewhere Load that hash and perform

How can I use jinja2 in python sanic?

According to my search. There are two main views: Install and use the sanic_jinja2 Just use the jinja2 But above two methods didn't work to me(Maybe it's my fau

I am running my code on google colab. Am getting RuntimeError: CUDA error: device-side assert triggered.Error is showing for torch.manual_seed(seed)

import random total_steps = 1 seed = 42 random.seed(seed) np.random.seed(seed) torch.manual_seed(seed) Below is the error am getting RuntimeError Traceback (mo

Webscraping sale prices from a grocery store- Am I on the right track or is there a simpler way?

I am new to all of this, and this is my first real coding project so forgive me if the answer is obvious :) I am trying to extract sale items from [my grocery s

Need help finding the smallest number and ending the program with -1

This is what I got: H = int(input("Enter a number or enter -1 to end)")) smallest = H counter=0 while(True): number = int(input("Enter a number: ")) if

Templates do not show image. Django

Here is what i tried to do: in my settings.py: TEMPLATES = [ ... 'OPTIONS': { 'context_processors': [ ...

LabelEncoding a permutation of combination of columns

I'd like to create class labels for a permutation of two columns using sklearn's LabelEncoder(). How do I achieve the following behavior? import pandas as pd im

Python requests library - POST requests takes too long

I have a problem with the python requests library. I try to send a simple POST request to my Keycloak server, to introspect an access token. I tested in in Post

How to use recursion to sum up a list of numbers up until a certain index

I have to write a code that makes use of recursion to sum numbers in a list up until the index is equal to a pre-determined integer value. i.e. list = [1,4,8,