2006年12月26日 星期二 14:21
怎么理解a[1:3,:-1:2]? >>> a array([[ 0., 1., 2., 3., 4., 5.], [ 6., 7., 8., 9., 10., 11.], [ 12., 13., 14., 15., 16., 17.], [ 18., 19., 20., 21., 22., 23.], [ 24., 25., 26., 27., 28., 29.]]) >>> a[1:3,:-1:2] array([[ 6., 8., 10.], [ 12., 14., 16.]])
2006年12月26日 星期二 14:34
On 12/26/06, linda. s <samrobertsmith在gmail.com> wrote: > 怎么理解a[1:3,:-1:2]? 很直观哪?! 将原数组的第2元素和 [:-1:2] 组成新数组, 不过 [:-1:2] 是什么操作? > >>> a > array([[ 0., 1., 2., 3., 4., 5.], > [ 6., 7., 8., 9., 10., 11.], > [ 12., 13., 14., 15., 16., 17.], > [ 18., 19., 20., 21., 22., 23.], > [ 24., 25., 26., 27., 28., 29.]]) > >>> a[1:3,:-1:2] > array([[ 6., 8., 10.], > [ 12., 14., 16.]]) > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese -- '''Time is unimportant, only life important! blog@ http://blog.zoomquiet.org/pyblosxom/ wiki@ http://wiki.woodpecker.org.cn/moin/ZoomQuiet douban@ http://www.douban.com/people/zoomq/ ____________________________________ Please use OpenOffice.org to replace M$ office. http://zh.openoffice.org Please use 7-zip to replace WinRAR/WinZip. http://7-zip.org/zh-cn/ You can get the truely Freedom from software. '''
2006年12月26日 星期二 14:40
1:3£¬È¡³öµÚ1¡¢2¸öÔªËØ¡ª¡ªÁ½¸öÁбí :-1:2 ÿ¸öÁбíÀ´ÓÍ·µ½µ¹ÊýµÚÒ»¸öÖ®¼ä²½³¤Îª2È¡ÔªËØ 2006/12/26, Zoom. Quiet <zoom.quiet在gmail.com>: > > On 12/26/06, linda. s <samrobertsmith在gmail.com> wrote: > > ÔõôÀí½âa[1:3,:-1:2]? > ºÜÖ±¹ÛÄÄ£¿£¡ > ½«ÔÊý×éµÄµÚ2ÔªËØºÍ [:-1:2] ×é³ÉÐÂÊý×飬 > ²»¹ý [:-1:2] ÊÇʲô²Ù×÷£¿ > > > >>> a > > array([[ 0., 1., 2., 3., 4., 5.], > > [ 6., 7., 8., 9., 10., 11.], > > [ 12., 13., 14., 15., 16., 17.], > > [ 18., 19., 20., 21., 22., 23.], > > [ 24., 25., 26., 27., 28., 29.]]) > > >>> a[1:3,:-1:2] > > array([[ 6., 8., 10.], > > [ 12., 14., 16.]]) > > _______________________________________________ > > python-chinese > > Post: send python-chinese在lists.python.cn > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > -- > '''Time is unimportant, only life important! > blog@ http://blog.zoomquiet.org/pyblosxom/ > wiki@ http://wiki.woodpecker.org.cn/moin/ZoomQuiet > douban@ http://www.douban.com/people/zoomq/ > ____________________________________ > Please use OpenOffice.org to replace M$ office. > http://zh.openoffice.org > Please use 7-zip to replace WinRAR/WinZip. > http://7-zip.org/zh-cn/ > You can get the truely Freedom from software. > ''' > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20061226/76b96e68/attachment-0001.html
2006年12月26日 星期二 14:53
On 12/26/06, wkssy <delux25在gmail.com> wrote: > 1:3,取出第1、2个元素——两个列表 是也乎,1:3 是取 第2,3 元素 > :-1:2 每个列表里,从头到倒数第一个之间步长为2取元素 > > 2006/12/26, Zoom. Quiet <zoom.quiet在gmail.com>: > > > > On 12/26/06, linda. s <samrobertsmith在gmail.com> wrote: > > > 怎么理解a[1:3,:-1:2]? > > 很直观哪?! > > 将原数组的第2元素和 [:-1:2] 组成新数组, > > 不过 [:-1:2] 是什么操作? > > > > > >>> a > > > array([[ 0., 1., 2., 3., 4., 5.], > > > [ 6., 7., 8., 9., 10., 11.], > > > [ 12., 13., 14., 15., 16., 17.], > > > [ 18., 19., 20., 21., 22., 23.], > > > [ 24., 25., 26., 27., 28., 29.]]) > > > >>> a[1:3,:-1:2] > > > array([[ 6., 8., 10.], > > > [ 12., 14., 16.]]) > > > _______________________________________________ > > > python-chinese > > > Post: send python-chinese在lists.python.cn > > > Subscribe: send subscribe to > python-chinese-request在lists.python.cn > > > Unsubscribe: send unsubscribe to > python-chinese-request在lists.python.cn > > > Detail Info: > http://python.cn/mailman/listinfo/python-chinese > > > > > > -- > > '''Time is unimportant, only life important! > > blog@ http://blog.zoomquiet.org/pyblosxom/ > > wiki@ http://wiki.woodpecker.org.cn/moin/ZoomQuiet > > douban@ http://www.douban.com/people/zoomq/ > > ____________________________________ > > Please use OpenOffice.org to replace M$ office. > > http://zh.openoffice.org > > Please use 7-zip to replace WinRAR/WinZip. > > http://7-zip.org/zh-cn/ > > You can get the truely Freedom from software. > > ''' > > _______________________________________________ > > python-chinese > > Post: send python-chinese在lists.python.cn > > Subscribe: send subscribe to > python-chinese-request在lists.python.cn > > Unsubscribe: send unsubscribe to > python-chinese-request在lists.python.cn > > Detail Info: > http://python.cn/mailman/listinfo/python-chinese > > > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to > python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to > python-chinese-request在lists.python.cn > Detail Info: > http://python.cn/mailman/listinfo/python-chinese > -- '''Time is unimportant, only life important! blog@ http://blog.zoomquiet.org/pyblosxom/ wiki@ http://wiki.woodpecker.org.cn/moin/ZoomQuiet douban@ http://www.douban.com/people/zoomq/ ____________________________________ Please use OpenOffice.org to replace M$ office. http://zh.openoffice.org Please use 7-zip to replace WinRAR/WinZip. http://7-zip.org/zh-cn/ You can get the truely Freedom from software. '''
2006年12月26日 星期二 15:01
°³ÊýÊý´Ó0¿ªÊ¼£¬ºÇºÇ¡£¡£ -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20061226/33fe88d9/attachment.htm
2006年12月26日 星期二 15:03
第一个元素下标为0,所以1:3取第1,2个元素。 按照人们习惯从元素从1开始的话,那就是第2,3个元素。 2006/12/26, Zoom. Quiet <zoom.quiet at gmail.com>: > > On 12/26/06, wkssy <delux25 at gmail.com> wrote: > > 1:3,取出第1、2个元素――两个列表 > 是也乎,1:3 是取 第2,3 元素 > > > :-1:2 每个列表里,从头到倒数第一个之间步长为2取元素 > > > > 2006/12/26, Zoom. Quiet <zoom.quiet at gmail.com>: > > > > > > On 12/26/06, linda. s <samrobertsmith at gmail.com> wrote: > > > > 怎么理解a[1:3,:-1:2]? > > > 很直观哪?! > > > 将原数组的第2元素和 [:-1:2] 组成新数组, > > > 不过 [:-1:2] 是什么操作? > > > > > > > >>> a > > > > array([[ 0., 1., 2., 3., 4., 5.], > > > > [ 6., 7., 8., 9., 10., 11.], > > > > [ 12., 13., 14., 15., 16., 17.], > > > > [ 18., 19., 20., 21., 22., 23.], > > > > [ 24., 25., 26., 27., 28., 29.]]) > > > > >>> a[1:3,:-1:2] > > > > array([[ 6., 8., 10.], > > > > [ 12., 14., 16.]]) > > > > _______________________________________________ > > > > python-chinese > > > > Post: send python-chinese at lists.python.cn > > > > Subscribe: send subscribe to > > python-chinese-request at lists.python.cn > > > > Unsubscribe: send unsubscribe to > > python-chinese-request at lists.python.cn > > > > Detail Info: > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > -- > > > '''Time is unimportant, only life important! > > > blog@ http://blog.zoomquiet.org/pyblosxom/ > > > wiki@ http://wiki.woodpecker.org.cn/moin/ZoomQuiet > > > douban@ http://www.douban.com/people/zoomq/ > > > ____________________________________ > > > Please use OpenOffice.org to replace M$ office. > > > http://zh.openoffice.org > > > Please use 7-zip to replace WinRAR/WinZip. > > > http://7-zip.org/zh-cn/ > > > You can get the truely Freedom from software. > > > ''' > > > _______________________________________________ > > > python-chinese > > > Post: send python-chinese at lists.python.cn > > > Subscribe: send subscribe to > > python-chinese-request at lists.python.cn > > > Unsubscribe: send unsubscribe to > > python-chinese-request at lists.python.cn > > > Detail Info: > > http://python.cn/mailman/listinfo/python-chinese > > > > > > _______________________________________________ > > python-chinese > > Post: send python-chinese at lists.python.cn > > Subscribe: send subscribe to > > python-chinese-request at lists.python.cn > > Unsubscribe: send unsubscribe to > > python-chinese-request at lists.python.cn > > Detail Info: > > http://python.cn/mailman/listinfo/python-chinese > > > > > -- > '''Time is unimportant, only life important! > blog@ http://blog.zoomquiet.org/pyblosxom/ > wiki@ http://wiki.woodpecker.org.cn/moin/ZoomQuiet > douban@ http://www.douban.com/people/zoomq/ > ____________________________________ > Please use OpenOffice.org to replace M$ office. > http://zh.openoffice.org > Please use 7-zip to replace WinRAR/WinZip. > http://7-zip.org/zh-cn/ > You can get the truely Freedom from software. > ''' > _______________________________________________ > python-chinese > Post: send python-chinese at lists.python.cn > Subscribe: send subscribe to python-chinese-request at lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese -------------- next part -------------- An HTML attachment was scrubbed... URL: http://python.cn/pipermail/python-chinese/attachments/20061226/3088a47f/attachment-0001.html
Zeuux © 2025
京ICP备05028076号