Replacing Numpy Array With Max Value March 03, 2024 Post a Comment I have an array, a = np.array([[0,9,8],[5,6,4]]) how to replace the each array in axis 1 with the max value of its array? excepting output- a = np.array([9,6]) where 9 is the maxSolution 1: You should usenp.max(a, axis=1) CopyLink to documentation Solution 2: another implementation you can do thisBaca JugaContinous Alphabetic List In Python And Getting Every Value Of ItHow To Import Word2vec Into Tensorflow Seq2seq Model?Pyqt5 Cannot Update Progress Bar From Thread And Received The Error "cannot Create Children For A Parent That Is In A Different Thread"np.array([max(i) for i in a]) Copy Share You may like these postsSubprocess In Python Add VariablesWhy I Use Selenium To Copy The Xpath But Get Nothing?Counting The Words A Character Said In A Movie ScriptWhich Sqlalchemy Column Type Should Be Used For Binary Data? Post a Comment for "Replacing Numpy Array With Max Value"
Post a Comment for "Replacing Numpy Array With Max Value"