I have a numpy structured array where I need to control the data types of the individual elements.
This is my example:
y = array([(True, 144.0),
(True, 86.0),
(True, 448.0),
(True, 76.0),
(True, 511.0)], dtype=object)
If I do:
print(y.dtype.fields)
I get back:
None
However, what I wanted was "bool" and "float".
If I access the individual elements, such as y[0][0]
and y[0][1]
I surely see that they are indeed bool and float.
I am super confused with this. Any ideas?
I need this because I use the packge "sciki-survival gradient boosting":https://scikit-survival.readthedocs.io/en/latest/generated/sksurv.ensemble.GradientBoostingSurvivalAnalysis.html#sksurv.ensemble.GradientBoostingSurvivalAnalysis.fit Where the input needs to be a structured array of type "bool" and "float".