'How do we plot a 3D numpy array or a 3D DataFrame?

I've got a 3D numpy array with elements being 0 or 1. What I need is to plot the array with the indices as the coordinates (x,y,z) and the colour of the point depending upon if the value contained in the element is 0 or 1. I'm not very great at matplotlib or anything, so looking for recommendations.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source