Filter out the nonzero values in a dense axis array

Please quote your code and post an MWE.