online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
import numpy as np c = np.array([[[3,3,3],[2,2,2],[3,3,3],[4,4,4]],[[1,1,1],[2,2,2],[7,3,3],[4,4,4]],[[1,1,1],[3,3,3],[3,3,3],[4,4,4]],[[1,1,1],[2,2,2],[3,8,3],[3,3,3]],[[3,3,3],[2,2,2],[3,3,3],[4,4,4]]]) print("Content of c array is:") print(c) print("Shape of c array is:") print(c.shape) # I reshape my array to get only a 2D array c_copy = c.reshape(c.shape[0] * c.shape[1], c.shape[2]) # Then I loop through all the elements of the array to replace [3, 3, 3] by [0, 0, 0] c_copy[[np.array_equal(e, [3, 3, 3]) for e in c_copy]] = [0,0,0] # And I reshape my copy to get the original shape back c_modified = c_copy.reshape(c.shape) print("New c array is correctly modified... but it takes time:") print(c_modified)

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue