aãé©å½ãªN次å
é
åã¨ããã a[a_1, a_2, a_3, ]ã¨ããã¨ãé
åã®1ã¤ã®æåãåãåºããã a[ãªã¹ã]ã¨ããã¨ã1次å
é
åã®ãªã¹ãçªç®ã®æåã®ã¿åãåºããé
åãè¿ãã (ä¸ã®ç¨ã«é
åã®ï¼ã¤ã®æåã ãåãåºãããæã«ã¯tuple(ãªã¹ã)ã®ããã«tupleã«ãã¦æ¸¡ãã°è¯ãï¼ a[ãªã¹ã1,ãªã¹ã2,ãªã¹ã3, ]ã¨ããã¨ã1次å
ç®ããªã¹ã1ã§2次å
ç®ããªã¹ã2ã§ãã¨ãã£ãããã«åãåºããé
åãè¿ãã np.ix_ãã¤ãã£ã¦a[np.ix_([è¡],[å])]ã¨ããã¨è¡åã®ä¸é¨ã®è¡ã¨åã®ã¿åãåºããæ°ããè¡åãä½ããã â»ããã¾ã§ã®ãªã¹ãã¯é
åã«ãã¦ãåãã åããã¨ãboolå¤ã使ã£ã¦ãa[[è¡ã®bool],[åã®bool],[3次å
ç®ã®bool], ]ã¨ãåºæ¥ã(ããã¯ãªã¹ãã«ããã¨ãFalse=0, True=1ã¨è§£éãããã®ã§æ³¨æ)ã import numpy as
{{#tags}}- {{label}}
{{/tags}}