简体   繁体   English

如何在 spyder 中显示数据帧?

[英]how can i display data frames in spyder?

I want to see the head of a data frame on spyder.我想在 spyder 上查看数据框的头部。 in the variable explorer it only shows me the entire data frame.在变量资源管理器中,它只向我显示整个数据框。

when i use print(data_frame.head()) , i see on the console only the first and last columns, and its also not very pleasant to see data frames on the console in spyder.当我使用print(data_frame.head())时,我在控制台上只看到第一列和最后一列,而且在 spyder 的控制台上看到数据帧也不是很愉快。 on the contrary in jupyter it looks very good an convinient.相反,在 jupyter 中,它看起来非常方便。

below you can see how i see data frames on spyder's console, how can i see all the columns like in jupyter?下面你可以看到我如何在 spyder 的控制台上看到数据框,我如何看到 jupyter 中的所有列? and also on spyder i must use print() to display the output, unless i run a single line.而且在 spyder 上,我必须使用print()来显示 output,除非我运行一行。

   order_id  ...  item_price
0         1  ...      $2.39 
1         1  ...      $3.39 
2         1  ...      $3.39 
3         1  ...      $2.39 
4         2  ...     $16.98 
5         3  ...     $10.98 
6         3  ...      $1.69 
7         4  ...     $11.75 
8         4  ...      $9.25 
9         5  ...      $9.25 

( Spyder maintainer here ) You said 这里是 Spyder 维护者)你说

how can i see all the columns like in jupyter?我怎样才能看到 jupyter 中的所有列?

That's not possible at the moment, sorry.暂时不可以,抱歉。

Instead, you need to use our Variable Explorer to view dataframes.相反,您需要使用我们的变量资源管理器来查看数据框。 There we display all variables that you've created in the console.在那里,我们显示您在控制台中创建的所有变量。 After double-clicking on your dataframe, Spyder will show its contents in a separate window, like this双击您的 dataframe 后,Spyder 将在单独的 window 中显示其内容,如下所示

Spyder中的数据框

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM