Paul, if you are working with small arrays you could make your weight a multivalue parameter and enter the weights one at a time ( I am using pro so I don't have an example on hand. Alternately you could specify a string parameter and parse it into its component parts. This is demonstrated with some annotation here
import numpy as np
cols = 5
wghts = "1 3 2 5 4"
wghts = [int(i) for i in wghts.split(" ")]
x = np.zeros((cols, 3), dtype=np.float64)
x[:, 0] = np.arange(cols)
x[:, 1] = np.array(wghts)
s = np.sum(x[:,1])
x[:, 2] = x[:,1]/s
print("demo ...\n{}".format(x))
demo ...
[[0. 1. 0.06666667]
[1. 3. 0.2 ]
[2. 2. 0.13333333]
[3. 5. 0.33333333]
[4. 4. 0.26666667]]
Alternately if you want a structured array (or even a recarray) you can specify the dtype for each column and assign column/field names to provide context and provide access to the data by name rather than index number...
For example
dt = [('ID', '<i4'), ('Weight', '<f8'), ('Standard_wght', '<f8')]
x = np.zeros((cols,), dtype=dt)
x['ID'] = np.arange(cols)
x['Weight'] = np.array(wghts)
s = np.sum(x['Weight'])
x['Standard_wght'] = x['Weight']/s
print("demo ...\n{!r:}".format(x))
demo ...
array([(0, 1., 0.06666667), (1, 3., 0.2 ), (2, 2., 0.13333333),
(3, 5., 0.33333333), (4, 4., 0.26666667)],
dtype=[('ID', '<i4'), ('Weight', '<f8'), ('Standard_wght', '<f8')])
x['Weight']
array([1., 3., 2., 5., 4.])
I have about 100 blog posts on geonet
The Py blog.... on numpy and related function and i have code on the
code sharing site search using my name