I have a list, d2_sum
, that contains numpy arrays and python lists, and I'm trying to convert all to python lists so I can perform some slicing operations. I have,
d2_sum_list = [i.tolist() if type(i) == 'numpy.ndarray' else i for i in d2_sum]
This executes with no errors but does not convert any of the numpy arrays to python lists. What am I missing here?