Pycharm python控制台对象信息以错误格式显示

时间:2017-01-06 16:28:13

标签: python ipython pycharm anaconda

有谁知道如何修复python控制台的格式?我正在使用来自Anaconda3的ipython运行Pycharm 2016.3.2 python控制台,当我尝试获取对象的信息时,我得到一个字符串,而不是可读的段落:

    pd.DataFrame?
{'text/plain': "Init signature: pd.DataFrame(data=None, index=None, columns=None, dtype=None, copy=False)\nDocstring:     \nTwo-dimensional size-mutable, potentially heterogeneous tabular data\nstructure with labeled axes (rows and columns). Arithmetic operations\nalign on both row and column labels. Can be thought of as a dict-like\ncontainer for Series objects. The primary pandas data structure\n\nParameters\n----------\ndata : numpy ndarray (structured or homogeneous), dict, or DataFrame\n    Dict can contain Series, arrays, constants, or list-like objects\nindex : Index or array-like\n    Index to use for resulting frame. Will default to np.arange(n) if\n    no indexing information part of input data and no index provided\ncolumns : Index or array-like\n    Column labels to use for resulting frame. Will default to\n    np.arange(n) if no column labels are provided\ndtype : dtype, default None\n    Data type to force, otherwise infer\ncopy : boolean, default False\n    Copy data from inputs. Only affects DataFrame / 2d ndarray input\n\nExamples\n--------\n>>> d = {'col1': ts1, 'col2': ts2}\n>>> df = DataFrame(data=d, index=index)\n>>> df2 = DataFrame(np.random.randn(10, 5))\n>>> df3 = DataFrame(np.random.randn(10, 5),\n...                 columns=['a', 'b', 'c', 'd', 'e'])\n\nSee also\n--------\nDataFrame.from_records : constructor from tuples, also record arrays\nDataFrame.from_dict : from dicts of Series, arrays, or dicts\nDataFrame.from_items : from sequence of (key, value) pairs\npandas.read_csv, pandas.read_table, pandas.read_clipboard\nFile:           c:\\apps\\anaconda3\\lib\\site-packages\\pandas\\core\\frame.py\nType:           type\n"}

应该是这种格式:

In [4]: pd.DataFrame?
Init signature: pd.DataFrame(data=None, index=None, columns=None, dtype=None, copy=False)
Docstring:
Two-dimensional size-mutable, potentially heterogeneous tabular data
structure with labeled axes (rows and columns). Arithmetic operations
align on both row and column labels. Can be thought of as a dict-like
container for Series objects. The primary pandas data structure

Parameters
----------
data : numpy ndarray (structured or homogeneous), dict, or DataFrame
    Dict can contain Series, arrays, constants, or list-like objects
index : Index or array-like
    Index to use for resulting frame. Will default to np.arange(n) if
    no indexing information part of input data and no index provided
columns : Index or array-like
    Column labels to use for resulting frame. Will default to
---Return to continue, q to quit---

2 个答案:

答案 0 :(得分:2)

我刚从PyCharm的人那里得到回复说这个问题只出现在IPython 5上,所以解决办法是恢复到早期版本,直到解决了......

答案 1 :(得分:1)

没有代表发表评论,只想链接到youtrack https://youtrack.jetbrains.com/issue/PY-21591上的错误,以便人们可以看到此修补程序何时发布。 如前所述,解决方案是回滚到5之前的版本