2

在 IPython 会话中,我有以下内容:

> my_array?
Type:       ndarray
String Form:
[[ 1.]
           [ 1.]
           [ 1.]
           [ 1.]
           [ 1.]
           [ 1.]
           [ 1.]
           [ 1.]
           [ 1.]
           [ 1.]
           [ 1.]
           [ 1.]
           [ 1.]
           [ 1.] <...> [ 1.]
           [ 1.]
           [ 1.]
           [ 1.]
           [ 1.]
           [ 1.]
           [ 1.]
           [ 1.]
           [ 1.]
           [ 1.]
           [ 1.]
           [ 1.]
           [ 1.]
           [ 1.]]
Length: 500

上面是什么<...> 意思?我有一维数组的一维数组还是其他东西?

4

1 回答 1

3

<...>只是当字符串太长时,IPython 如何跳过值。在IPython/core/oinspect.py

    # String form, but snip if too long in ? form (full in ??)
    if detail_level >= self.str_detail_level:
        try:
            ostr = str(obj)
            str_head = 'string_form'
            if not detail_level and len(ostr)>string_max:
                ostr = ostr[:shalf] + ' <...> ' + ostr[-shalf:]
                ostr = ("\n" + " " * len(str_head.expandtabs())).\
                        join(q.strip() for q in ostr.split("\n"))
            out[str_head] = ostr
        except:
            pass
于 2013-02-01T03:04:23.427 回答