db_descriptors2 = npinsertdb_descriptors 2 File CUsersThinkAppDataLocalProgramsPythonPython36libsite-packagesnumpylibfunction_basepy line 4584 in insert values = arrayvalues copy=False ndmin=arrn
The error is occurring because you are trying to insert a string ("...") into a NumPy array that expects numeric values.
If you want to insert the string "..." into the NumPy array, you will need to convert the array to a different data type that allows strings. One option is to use the object data type, which can store any Python object including strings. Here's an example:
db_descriptors2 = np.insert(db_descriptors, 2, "...", axis=0).astype(object)
In this example, axis=0 specifies that the insertion should happen along the first axis of the array (i.e., as a new row).
Alternatively, if you want to insert a numeric value at that position, you will need to provide a valid numeric value instead of the string "..." in the np.insert() function
原文地址: https://www.cveoy.top/t/topic/iLMZ 著作权归作者所有。请勿转载和采集!