【问题标题】:Pycharm python console object info appears in bad formatPycharm python控制台对象信息出现格式错误
【发布时间】:2017-05-21 11:10:51
【问题描述】:

有人知道如何修复 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---

【问题讨论】:

    标签: python ipython pycharm anaconda


    【解决方案1】:

    我刚刚收到 PyCharm 人员的回复,说这个问题只出现在 IPython 5 中,所以解决方案是恢复到早期版本,直到问题得到解决......

    【讨论】:

      【解决方案2】:

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

      【讨论】:

        猜你喜欢
        • 2015-11-19
        • 1970-01-01
        • 2017-10-03
        • 1970-01-01
        • 2015-06-17
        • 1970-01-01
        • 2017-01-25
        • 1970-01-01
        • 2014-11-13
        相关资源
        最近更新 更多