When I print out my list it prints as
[array([7], dtype=int64),
array([11], dtype=int64),
array([15, 19, 23, 27, 31, 35, 39, 43, 47, 51, 55, 59, 63, 67], dtype=int64)]
But I want it like [7,11,15,19,23, ...]
I am using pandas to get the index value of columns which matches certain conditions, in 1st 2 conditions the values were unique hence it gives output array array([7], dtype=int64), array([11], dtype=int64)
, but then one of the condition is matched by multiple index value of columns hence it produces array([15, 19, 23, 27, 31, 35, 39, 43, 47, 51, 55, 59, 63, 67])
But I want it as a list of numbers as [7,11,15,19,23, ...]
So what can I do?
Here is my code
dy= df.xs(0)
for id in dy:
if 'ID' in str(id):
#ID list Index Values
zr= dy[dy==id].index.value
zr_list = zr_list.append(zr)
print(zr_list)
Output
[array([7], dtype=int64),
array([11], dtype=int64),
array([15, 19, 23, 27, 31, 35, 39, 43, 47, 51, 55, 59, 63, 67],
dtype=int64)]