Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dataframe not showing in Pycharm

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 (e.g. 4x4) DataFrame.

However when I try to view a DataFrame (generated by custom script) of ~10,000 rows x ~50 columns, I get the message: "Nothing to show".

When I run the same script (that generates the DataFrame) in Spyder, I am able to view it, so I am pretty sure it's not an error in my script.

Does anyone know if there is a maximum size to the DataFrames that can be viewed in PyCharm, and if there is a way to change this?

EDIT:

It seems that the maximum size allowed is 1000 x 15 , as in some cases it gets truncated to this size (when the number of rows is too large, but when there are too many columns pycharm just says 'nothing to show').

Still, I would like to know if there is a way to increase the maximum allowed rows and columns viewable through the DataFrame viewer.

like image 345
BartDur Avatar asked Aug 15 '16 14:08

BartDur


People also ask

How do I display a DataFrame in Pycharm?

In the Variables tab of the Debug tool window, select an array or a DataFrame. Click a link View as Array/View as DataFrame to the right. Alternatively, you can choose View as Array or View as DataFrame from the context menu.

What does DataFrame () do in Python?

DataFrame. DataFrame is a 2-dimensional labeled data structure with columns of potentially different types. You can think of it like a spreadsheet or SQL table, or a dict of Series objects. It is generally the most commonly used pandas object.

How do I retrieve a DataFrame in Python?

The get() method returns the specified column(s) from the DataFrame. If you specify only one column, the return value is a Pandas Series object. To specify more than one column, specify the columns inside an array. The result will be a new DataFrame object.

How do I show DataFrame in pandas Python?

Example 1 : One way to display a dataframe in the form of a table is by using the display() function of IPython. display .

How do I view coordinates in PyCharm?

Currently, PyCharm supports coordinates in the following formats: WKT, WKB, and PostGIS geometry 4326. In the Database tool window ( View | Tool Windows | Database ), double-click the table with geographical data. Click the Show Options Menu icon () and select Show Geo Viewer.

Is there a database plugin in PyCharm?

I looked in PyCharm log for anything mentioning "database" but couldn't find any entries - well, there is one, for Database Navigator plugin, which is no longer compatible and I uninstalled it anyway, just to make sure it wasn't interfering. In plugins directory I only have 3 plugins, Docker, gherkin and mongo4idea.

How do I display a Dataframe in Python?

Example 1 : One way to display a dataframe in the form of a table is by using the display () function of IPython.display. Example 2: In this example we’ll use DataFrame.style. It returns a Styler object, which has useful methods for formatting and displaying DataFrames.

How do I preview a query in PyCharm?

To close the pane where the query is shown, press Escape. When you insert, delete, or modify data in a table editor, you can preview the query that PyCharm uses to perform selected operations. To preview the query, click the Preview pending changes button () on the toolbar.


2 Answers

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.

like image 186
Ahmad Avatar answered Oct 01 '22 00:10

Ahmad


As you said in your edit, there's a limit on the number of columns (on my PC though it's far less than 15). However, you can see the whole thing by typing:

df.values 

It will show you the whole dataframe, but without the names of the columns.


Edit:

To show the column names as well:

np.vstack([df.columns, df.values]) 
like image 35
Alaa M. Avatar answered Sep 30 '22 23:09

Alaa M.