PyCharm控制台无法正常显示

时间:2016-12-26 16:17:42

标签: pycharm

我正在我的计算机上设置PyCharm,并且交互式控制台似乎在显示输出结果时遇到问题。例如,当我尝试显示

  

命令?

我得到一个很乱的字符串而不是格式化的输出。

Python 3.5.2 |Anaconda custom (x86_64)| (default, Jul  2 2016, 17:52:12) 
In[2]: import numpy as np
In[3]: np.sum?
{'text/plain': 'Signature: np.sum(a, axis=None, dtype=None, out=None, keepdims=False)\nDocstring:\nSum of array elements over a given axis.\n\nParameters\n----------\na : array_like\n    Elements to sum.\naxis : None or int or tuple of ints, optional\n    Axis or axes along which a sum is performed.  The default,\n    axis=None, will sum all of the elements of the input array.  If\n    axis is negative it counts from the last to the first axis.\n\n    .. versionadded:: 1.7.0\n\n    If axis is a tuple of ints, a sum is performed on all of the axes\n    specified in the tuple instead of a single axis or all the axes as\n    before.\ndtype : dtype, optional\n    The type of the returned array and of the accumulator in which the\n    elements are summed.  The dtype of `a` is used by default unless `a`\n    has an integer dtype of less precision than the default platform\n    integer.  In that case, if `a` is signed then the platform integer\n    is used while if `a` is unsigned then an unsigned integer of the\n    same precision as the platform integer is used.\nout : ndarray, optional\n    Alternative output array in which to place the result. It must have\n    the same shape as the expected output, but the type of the output\n    values will be cast if necessary.\nkeepdims : bool, optional\n    If this is set to True, the axes which are reduced are left in the\n    result as dimensions with size one. With this option, the result\n    will broadcast correctly against the input array.\n\nReturns\n-------\nsum_along_axis : ndarray\n    An array with the same shape as `a`, with the specified\n    axis removed.   If `a` is a 0-d array, or if `axis` is None, a scalar\n    is returned.  If an output array is specified, a reference to\n    `out` is returned.\n\nSee Also\n--------\nndarray.sum : Equivalent method.\n\ncumsum : Cumulative sum of array elements.\n\ntrapz : Integration of array values using the composite trapezoidal rule.\n\nmean, average\n\nNotes\n-----\nArithmetic is modular when using integer types, and no error is\nraised on overflow.\n\nThe sum of an empty array is the neutral element 0:\n\n>>> np.sum([])\n0.0\n\nExamples\n--------\n>>> np.sum([0.5, 1.5])\n2.0\n>>> np.sum([0.5, 0.7, 0.2, 1.5], dtype=np.int32)\n1\n>>> np.sum([[0, 1], [0, 5]])\n6\n>>> np.sum([[0, 1], [0, 5]], axis=0)\narray([0, 6])\n>>> np.sum([[0, 1], [0, 5]], axis=1)\narray([1, 5])\n\nIf the accumulator is too small, overflow occurs:\n\n>>> np.ones(128, dtype=np.int8).sum(dtype=np.int8)\n-128\nFile:      ~/anaconda/lib/python3.5/site-packages/numpy/core/fromnumeric.py\nType:      function\n'}

有关如何解决此问题的任何想法?

在MacOS 10.12.2上使用PyCharm CE 2016.3.1,使用Python 3.5.2 Anaconda作为我的翻译。

0 个答案:

没有答案
相关问题