I am very new to python and numpy. Trying to put into action a row vector with zeros as follows w = np.zeros (dim, 1)
Getting the error "TypeError: data type is incomprehensible". Appreciate any help. Thanks
See the documentation at np.zeros
If you call it the way you did, the size dimand the argument of the data type dtypeare 1, which is not a valid data type.
dim
dtype
1
Decision
import numpy as np dim = 3 # number of entries shp = (dim, 1) # shape tuple x = np.zeros(shp) # second argument 'dtype' is not used, default is 'float' print(x)
Source: https://habr.com/ru/post/1684606/More articles:User changes provided in the "Resolution from the settings screen" window - androidEclipse Oxygen Java Decompiler Plugin - javaCustom name with admin image on vacation - reactjsKotlin error when linking activity from inner class - androidSelect active md-tab md-tab-group inside md-dialog - javascriptThe JavaScript API for Google Maps must be downloaded directly from Google’s servers. - javascriptGit notes are missing after `Git clone --mirror` - gitJackson: get null reference to deserialization - javaпроверьте, произошло ли событие "смены" с клавиатуры - javascriptIncorrect focus position in ContentEditable Div using placeholder in IE - javascriptAll Articles