Quantcast
Channel: numpy.ndarray as Dictionary value - Stack Overflow
Browsing latest articles
Browse All 2 View Live

Answer by sshashank124 for numpy.ndarray as Dictionary value

You should use np.array_equal:S = np.zeros((3,3), dtype=int)if any(np.array_equal(S, i) for i in myDict.values()): print "Yes!"else: print "Sorry. No."[OUTPUT]Sorry. No.

View Article



numpy.ndarray as Dictionary value

I am storing numpy.ndarray as a value of a dictionary. My dictionary looks like:{0: array([[ 1, 0, -1], [ 0, -1, 0], [ 1, 0, 0]])}But when I am trying to find out if array exists in the dictionary...

View Article
Browsing latest articles
Browse All 2 View Live




Latest Images

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