Dataframe not showing in Pycharm

后端 未结 10 1340
旧时难觅i
旧时难觅i 2020-12-30 18:09

I am using PyCharm 2016.2.1 . When I try to view a Pandas dataframe through the newly added feature \'View as DataFrame\' in the debugger, this works as expected for a small

相关标签:
10条回答
  • 2020-12-30 19:01

    I have faced the same problem with PyCharm 2018.2.2. The reason was having a special character in a column's name as mentioned by Yunzhao .

    If your having a column name like 'R&D' changing it to 'RnD' will fix the problem. It's really strange JetBrains hasn't solved this problem for over 2 years.

    0 讨论(0)
  • 2020-12-30 19:06

    For the sake of completeness: I face the same problem, due to the fact that some elements in the index of the dataframe contain a question mark '?'. One should avoid that too, if you still want to use the data viewer. Data viewer still worked, if the index strings contain hashes or less-than/greather-than signs though.

    0 讨论(0)
  • 2020-12-30 19:09

    In the case that you don't strictly need to use the functionalities given by the DataFrame viewer, you can print the whole DataFrame in the output window, using:

    def print_full(x):
        pd.set_option('display.max_rows', len(x))
        print(x)
        pd.reset_option('display.max_rows')
    
    0 讨论(0)
  • 2020-12-30 19:13

    As of 2020-10-02, using PyCharm 2020.1.4, I found that this issue also occurs if the DataFrame contains a column containing a tuple.

    0 讨论(0)
提交回复
热议问题