Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Comparing 2 Rows, Slices

$
0
0
I have a numPy ndarray with the arbitrary values [1,2,3], [4,5,6]. Is there a way to compare "slices" ? For example, I would want to compare 1 to 4 or 2 to 5. I've been tinkering with numpy.max() for a while to no avail.

I thought something along the lines of this might work, but it doesn't.:

def xmax(r):
    xMax = np.max(r[0:2][0]) 
    return(xMax)



Any advice or direction is appreciated.

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>