python 2.7 -1

Python 2.7 (r27:82525, Jul  4 2010, 09:01:59) [MSC v.1500 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> c=arrange(24).reshape(2,3,4)

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    c=arrange(24).reshape(2,3,4)
NameError: name 'arrange' is not defined
>>> c=arange(24).reshape(2,3,4)

Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    c=arange(24).reshape(2,3,4)
NameError: name 'arange' is not defined
>>> c = arange(24).reshape(2,3,4)

Traceback (most recent call last):
  File "<pyshell#2>", line 1, in <module>
    c = arange(24).reshape(2,3,4)
NameError: name 'arange' is not defined
>>> a =array([20,30,40,50])

Traceback (most recent call last):
  File "<pyshell#3>", line 1, in <module>
    a =array([20,30,40,50])
NameError: name 'array' is not defined
>>> from numpy import *
>>> a =array([20,30,40,50])
>>> a
array([20, 30, 40, 50])
>>> c = arange(24).reshape(2,3,4)
>>> c
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]]])
>>> c = arange(24)
>>> c
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])
>>> import matplotlib.pyplot as plt

Traceback (most recent call last):
  File "<pyshell#11>", line 1, in <module>
    import matplotlib.pyplot as plt
  File "C:\Python27\lib\site-packages\matplotlib\pyplot.py", line 29, in <module>
    from matplotlib.figure import Figure, figaspect
  File "C:\Python27\lib\site-packages\matplotlib\figure.py", line 36, in <module>
    from matplotlib.axes import Axes, SubplotBase, subplot_class_factory
  File "C:\Python27\lib\site-packages\matplotlib\axes.py", line 20, in <module>
    import matplotlib.dates as _  # <-registers a date unit converter
  File "C:\Python27\lib\site-packages\matplotlib\dates.py", line 119, in <module>
    from dateutil.rrule import (rrule, MO, TU, WE, TH, FR, SA, SU, YEARLY,
  File "C:\Python27\lib\site-packages\dateutil\rrule.py", line 18, in <module>
    from six import advance_iterator, integer_types
ImportError: No module named six


>>> import matplotlib.pyplot as plt; plt.plot([1,2,3]); plt.ylabel('some numbers'); plt.show();
Python 2.7 (r27:82525, Jul  4 2010, 09:01:59) [MSC v.1500 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> linspace(0,2,9)

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    linspace(0,2,9)
NameError: name 'linspace' is not defined
>>> from numpy import *
>>> linspace(0,2,9)
array([ 0.  ,  0.25,  0.5 ,  0.75,  1.  ,  1.25,  1.5 ,  1.75,  2.  ])
>>> a= arange(15).reshape(3,5)
>>> a
array([[ 0,  1,  2,  3,  4],
       [ 5,  6,  7,  8,  9],
       [10, 11, 12, 13, 14]])
>>> b=arange(6,7,8)
>>> b
array([6])
>>> b=array(6,7,8)

Traceback (most recent call last):
  File "<pyshell#7>", line 1, in <module>
    b=array(6,7,8)
ValueError: only 2 non-keyword arguments accepted
>>> b=array([6,7,8])
>>> b
array([6, 7, 8])
>>> a.shape
(3, 5)
>>> a.ndim
2
>>> a.ndim
2
>>> a.dtype
dtype('int32')
>>> 
>>> a.dtype.name
'int32'
>>> a
array([[ 0,  1,  2,  3,  4],
       [ 5,  6,  7,  8,  9],
       [10, 11, 12, 13, 14]])
>>> a.itemsize
4
>>> a.si

Traceback (most recent call last):
  File "<pyshell#18>", line 1, in <module>
    a.si
AttributeError: 'numpy.ndarray' object has no attribute 'si'
>>> a.size
15
>>> type
<type 'type'>
>>> type(a)
<type 'numpy.ndarray'>
>>> type(b)
<type 'numpy.ndarray'>
>>> a=array([2,3,4])
>>> a
array([2, 3, 4])
>>> a.dtype
dtype('int32')
>>> b.dtype
dtype('int32')
>>> b
array([6, 7, 8])
>>> b=array([1.2,3.5,5.1])
>>> b
array([ 1.2,  3.5,  5.1])
>>> b.dtype
dtype('float64')
>>> 


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值