index-error

IndexError when using Enumerated Indexes in NumPy

IndexError when using Enumerated Indexes in NumPy Question: I am trying to create a fifth-order FIR filter in Python described by the following difference equation (apologies dark mode users but LaTeX is not yet supported on SO): def filter(x): h = np.array([-0.0147, 0.173, 0.342, 0.342, 0.173, -0.0147]) y = np.zeros_like(x) buf_array = np.zeros_like(h) buf = …

Total answers: 1

Why am I getting IndexError: list index out of range error even though I have a proper list

Why am I getting IndexError: list index out of range error even though I have a proper list Question: with open(‘Input’,’r’) as f: while len(a)>0: a=f.readline() #I am going to search for a command to execute in the txt file w_in_line=a.split(‘,’) #words in line command_word_box=w_in_line[0].split()#I took the command word out of the line command_word=str(command_word_box[0]) pat_name=w_in_line[0].replace(command_word,”) …

Total answers: 1

length of list read from a csv varies, depending on when a read is performed

length of list read from a csv varies, depending on when a read is performed Question: I’m trying to write a simple function that reads in a csv and stores its content inside a list and either returns said list formatted or a string containing the information on why the csv is empty. For clarification, …

Total answers: 1

List index out of range in visualize_cv2.py

List index out of range in visualize_cv2.py Question: I want to launch mask-rcnn model from visualize_cv2.py. My goal is train only on 1 element from class_names – person. For this I create class_names1(added full code from this python file for better understanding): import cv2 import numpy as np import os import sys import coco import …

Total answers: 1

Nested loop used in hcf finding code in Python returns IndexError:index out of range

Nested loop used in hcf finding code in Python returns IndexError:index out of range Question: I created a program that will generate the HCF(highest common factor) of the given two numbers. f1 = [] f2 = [] num1 = int(input(“Enter first number:”)) num2 = int(input(“Enter second number:”)) n1 = num1 + 1 n2 = num2 …

Total answers: 3

I got an IndexError: list index out of range in sys.argv[1]

I got an IndexError: list index out of range in sys.argv[1] Question: I want to plot this code but it entered IndexError: list index out of range in the line: k = float(sys.argv[1]) Can anyone help me how to fix this? canWidth=500 canHeight=500 **strong text** def setupWindow () : global win, canvas from tkinter import …

Total answers: 1