I'm using Python3.x.
The bricks = [] the data is dataframe single element array which contains number and some negative numbers
for delta in data:
if delta > 0:
bricks.extend([1] * delta)
else:
bricks.extend([-1] * abs(delta))
The above code throws error, without affecting the outcome how to correct the code which will run without errors
The error here is:
bricks.extend([1] * delta) TypeError: 'numpy.float64' object cannot be interpreted as an integer
Note :Community, before giving negative numbers, marked as duplicate provide a solution and then mark as you wish.