May-06-2024, 01:21 PM
I have these two lists:
How to generate a doubles array from these two lists by
Then how to make a counter on this array using
I tired something like:
X=np.arange(0,50,0.1)
Y=np.arange(10,20,1)
How to generate a doubles array from these two lists by
np.zeros_like()
Then how to make a counter on this array using
enumerate()
I tired something like:
import numpy as np import scipy.special from scipy import integrate from scipy.special import kn import matplotlib.pyplot as plt import math import time, sys from itertools import count X=np.arange(0,50,0.1) Y=np.arange(10,20,1) res = np.zeros_like((x, y)) for i, (va, val) in enumerate(zip(va, val)) y= va+val res[i]=y return resBut it gives an error:
UnboundLocalError: local variable ‘y’ referenced before assignment