I have these two lists:
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 res
But it gives an error: UnboundLocalError: local variable ‘y’ referenced before assignment
Any help is appreciated!
New contributor
Dr. phy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1