Hi All,
My code is the following:
Thanks,
Jonathan
My code is the following:
import numpy import math a = numpy.arange(1, 11) b = numpy.arange(0, .02, .001) v = [] for c in a: v.append([]) for d in b: numpy.append(v[c],(1 / c ** 2) * math.exp( -c ** 2 * math.pi ** 2 * d))I'm looking to create an a x b array composed of the following:
Output:a[0]b[0] a[0]b[1] a[0]b[2] etc.
a[1]b[0] a[1]b[1] a[1]b[2] etc.
a[2]b[0] a[2]b[1] a[2]b[2] etc.
etc. etc. etc. etc.
How would I do this? As is my code is producing TypeError: list indices must be integers or slices, not numpy.float64.Thanks,
Jonathan
Larz60+ write Nov-23-2020, 08:41 AM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Fixed for you this time. Please use code tags on future posts.
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Fixed for you this time. Please use code tags on future posts.