ååã«å¼ãç¶ãnumpy使ãæ¹ãåå¼·ãã¦ããã¾ãï¼ ä»åã¯ndarrayãããã¼ã¿ãåå¾ããæ¹æ³ã«ã¤ãã¦ã¾ã¨ãã¦ããã¾ãï¼ ã¤ã³ãã¯ã·ã³ã° & ã¹ã©ã¤ã·ã³ã° ndarrayã¯pythonã®listã®æ¡å¼µã¨ãã¦å©ç¨ãããã¨ãã§ãã¾ãï¼ ãªã®ã§ï¼listã§ä½¿ããã¤ã³ããã¯ã¹åç §ãã¹ã©ã¤ã·ã³ã°ã¯åãããã«ä½¿ããã¨ãã§ãã¾ãï¼ # ndarrayçæ In [1]: a = np.arange(10) In [2]: a Out[2]: array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) # ã¤ã³ãã¯ã·ã³ã° In [3]: a[5] Out[3]: 5 # ã¹ã©ã¤ã·ã³ã° In [4]: a[5:8] Out[4]: array([5, 6, 7]) # ã¹ã©ã¤ã·ã³ã°ã«å¯¾ããä»£å ¥ï¼ããã¼ããã£ã¹ãï¼ In [5]: a[5:8] = 12 In [6]: a Out[6]:
{{#tags}}- {{label}}
{{/tags}}