如何在Google Colab中查看完整的行

用户名

我正在使用google colab pyton 3.x,并且具有以下数据框。我想在每一行和每一列上看到整个单元格。我该怎么办?我试过了pd.set_option('display.max_columns', 3000)但是没有

# importing pandas as pd 
import pandas as pd 

# dictionary of lists 
dict = {'name':["a1", "b2", "c2", "d3"], 
        'degree': ["We explained to customer how correct fees (100) were charged. Account balance was too low", "customer was late in paying fees and we have to charge fine", "customer's credit score was too low and we have to charge higher interest rate", "customer complained a lot and didnt listen to our explanation. I had to escalate the call"], 
        'score':[90, 40, 80, 98]} 

# creating a dataframe from a dictionary  
df = pd.DataFrame(dict) 
print (df)


  name                                             degree  score
0   a1  We explained to customer how correct fees (100...     90
1   b2  customer was late in paying fees and we have t...     40
2   c2  customer's credit score was too low and we hav...     80
3   d3  customer complained a lot and didnt listen to ...     98
完全没有

使用pd.set_option('max_colwidth', <width>)对列宽和pd.set_option('max_rows', <rows>)为行数。
参见https://pandas.pydata.org/pandas-docs/stable/user_guide/options.html

[] pd.set_option('max_rows', 99999)
[] pd.set_option('max_colwidth', 400)
[] pd.describe_option('max_colwidth')

display.max_colwidth : int
    The maximum width in characters of a column in the repr of
    a pandas data structure. When the column overflows, a "..."
    placeholder is embedded in the output.
    [default: 50] [currently: 400]

[] df = pd.DataFrame(d)
[] df

  name                                                                                     degree   score
0   a1  We explained to customer how correct fees (100) were charged. Account balance was too low   90
1   b2  customer was late in paying fees and we have to charge fine                                 40
2   c2  customer's credit score was too low and we have to charge higher interest rate              80
3   d3  customer complained a lot and didnt listen to our explanation. I had to escalate the call   98

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

如何在 New Relic 中查看完整查询

如何在顶部查看完整命令?

如何在JTextArea中添加垂直和水平滚动条以查看完整文件-JAVA

如何在VSTS的(GIT)提交列表中查看完整的提交消息?

如何在Hyperledger Fabric基本网络示例中查看完整的订购者日志?

如何在sails.js中查看完整的相关模型?

我如何在 pycharm 中查看完整的 pandas.dataframe 列而不是“...”?

如何查看完整的httpd配置?

如何查看完整的符号链接路径

捕获异常时如何查看完整的堆栈跟踪

如何使用索引文件查看完整日历?

如何查看完整的流程/应用程序活动?

如何从systemctl状态服务查看完整日志?

如何在Android上使用Apache HttpClient查看完整的HttpPost请求

如何在xcode5上查看完整的构建日志?

如何在Lubuntu桌面上查看完整的文件名?

我们如何在 OMNeT++ 模拟的日志视图中查看完整历史记录

从控制台运行Java应用程序时如何查看完整的异常堆栈跟踪?

在以下情况下,如何使滚动条查看完整内容?

列出容器时如何查看完整的命令列字符串

如何查看完整的cron日志(不只是1天或更短的时间)?

如何设置视图或活动来处理以前的listactivity?例如“查看完整的详细信息页面”

如何在Google Colab中更改路径?

如何在Google Colab中安装Anaconda

如何在Google脚本中查看此API错误消息的完整服务器响应?

如何在Google Colab中处理来自Google Drive的视频

Google Colab中的图形不完整

在Google Colab中重定向或查看stderr

如何在python中查看相关方法的完整输出