欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

python_array[0][0]與array[0,0]的區(qū)別詳解

 更新時(shí)間:2020年02月18日 14:54:11   作者:糖糖糖-豆  
今天小編就為大家分享一篇python_array[0][0]與array[0,0]的區(qū)別詳解,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧

在學(xué)習(xí)python的時(shí)候,

看到有些 代碼中使用array[0][0] 來提取位置元素

不太明白。

動(dòng)手實(shí)驗(yàn)了一下

import numpy as np
a = np.array([np.arange(12),np.arange(12,24)])
>>>print a
[[ 0 1 2 3 4 5 6 7 8 9 10 11]
 [12 13 14 15 16 17 18 19 20 21 22 23]]

>>>print a[0][6]
6

[0][6] means: get the 1st array and the 7th element.

But what's the difference of [0,6]??
their are the same answer!!

>>>print a[0,6]
6

以上這篇python_array[0][0]與array[0,0]的區(qū)別詳解就是小編分享給大家的全部?jī)?nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。

相關(guān)文章

最新評(píng)論