python - How to select a row from a 2D tuple -


this straightforward thing can't it.

how go selecting "rows" (i use word row lack of better one) 2d (or nd) tuple?

a = [0,1,2,3] b = [4,5,6,7] c = (a,b) 

i.e., how result ([1,2],[5,6]) c?

i've tried c[:][1:2] result ([4, 5, 6, 7],)

you use comprehension:

tuple(x[1:3] x in c)  

Comments

Popular posts from this blog

symfony - InvalidConfigurationException in SecurityExtension.php line 429: No authentication listener registered for firewall "secured_area" -

angular ui router - 10 digest iterations reached in angularjs when using $state.go -

javascript - Handling constructor related functions while testing with mocha and sinon -