Typeerror Only Integer Scalar Arrays Can Be Converted To

[Solved] Typeerror Only Integer Scalar Arrays Can Be Converted To | Scala - Code Explorer | yomemimo.com
Question : TypeError: only integer scalar arrays can be converted to a scalar index

Answered by : mineman420

import numpy
ar1 = numpy.array(['Apple', 'Orange', 'Banana', 'Pineapple', 'Grapes'])
ar2 = numpy.array(['Onion', 'Potato'])
# incorrect way to call this function.
ar3 = numpy.concatenate(ar1, ar2)
# correct way to call this function.
ar3 = numpy.concatenate((ar1, ar2))
# you have to pass the arrays in a list or tuple!

Source : | Last Update : Thu, 18 Aug 22

Answers related to typeerror only integer scalar arrays can be converted to a scalar index

Code Explorer Popular Question For Scala