pandas options and settings
来源:互联网 发布:淘宝电动车便宜 编辑:程序博客网 时间:2024/06/06 10:58
pd.set_option(’precision’, 5)`
In [46]: pd.set_option(’max_colwidth’, 6)In [47]: dfOut[47]: 0 1 2 30 foo bar bim un...1 horse cow ba... apple
In [55]: df=pd.DataFrame(np.random.choice([0,1,np.nan],size=(10,10)))In [56]: dfOut[56]: 0 1 2 3 4 5 6 7 8 90 0 1 1 0 1 1 0 NaN 1 NaN1 1 NaN 0 0 1 1 NaN 1 0 12 NaN NaN NaN 1 1 0 NaN 0 1 NaN3 0 1 1 NaN 0 NaN 1 NaN NaN 04 0 1 0 0 1 0 0 NaN 0 05 0 NaN 1 NaN NaN NaN NaN 0 1 NaN6 0 1 0 0 NaN 1 NaN NaN 0 NaN7 0 NaN 1 1 NaN 1 1 1 1 NaN8 0 0 NaN 0 NaN 1 0 0 NaN NaN9 NaN NaN 0 NaN NaN NaN 0 1 1 NaN
display.chop_threshold sets at what level pandas rounds to zero when it displays a Series of DataFrame.Note, this does not effect the precision at which the number is stored.In [67]: df=pd.DataFrame(np.random.randn(6,6))In [68]: pd.set_option(’chop_threshold’, 0)In [69]: dfOut[69]: 0 1 2 3 4 50 -0.198 0.966 -1.523 -0.117 0.296 -1.0481 1.641 1.906 2.772 0.089 -1.144 -0.6332 0.925 -0.006 -0.820 -0.601 -1.039 0.8253 -0.824 -0.338 -0.928 -0.840 0.249 -0.1094 0.432 -0.461 0.337 -3.208 -1.536 0.4105 -0.673 -0.741 -0.111 -2.673 0.864 0.061In [70]: pd.set_option(’chop_threshold’, .5)In [71]: dfOut[71]: 0 1 2 3 4 50 0.000 0.966 -1.523 0.000 0.000 -1.0481 1.641 1.906 2.772 0.000 -1.144 -0.6332 0.925 0.000 -0.820 -0.601 -1.039 0.8253 -0.824 0.000 -0.928 -0.840 0.000 0.0004 0.000 0.000 0.000 -3.208 -1.536 0.0005 -0.673 -0.741 0.000 -2.673 0.864 0.000
In [74]: pd.set_option(’colheader_justify’, ’right’)In [75]: dfOut[75]: A B C0 0.933 0.3 01 0.289 0.2 02 1.325 0.2 03 0.589 0.7 04 0.531 0.1 05 -1.199 0.7 0In [76]: pd.set_option(’colheader_justify’, ’left’)In [77]: dfOut[77]: A B C0 0.933 0.3 01 0.289 0.2 02 1.325 0.2 03 0.589 0.7 04 0.531 0.1 05 -1.199 0.7 0
0 0
- pandas options and settings
- File-->Settings与Tools-->Options的区别
- BOOTP and DHCP options
- Inna and Choose Options
- NAT Tools and Settings
- pythonpath and django settings
- Controlling bash Features and Options
- A. Inna and Choose Options
- A. Inna and Choose Options
- codeforces Inna and Choose Options
- A - Inna and Choose Options
- GCC Compile and Link options
- Kibana User Guide [4.2] » Settings » Setting Advanced Options
- 转移Documents and Settings妙法
- yahoo pop3 and smtp settings
- Documents and Settings拒绝访问
- UE4 Texture Support and Settings
- pandas indexing and slicing data
- mysql游标的使用
- Online Judge System For SzNOI 题库 语法百题 c++ d023
- Python 代码风格 和 PEP8
- Arcgis Server开发使用query报错
- 南阳oj 寻找球号(二) 数据结构 题目138
- pandas options and settings
- memory balloon
- gnome配置
- IOS 二维码生成 同时打开网页
- 系统备份只需简单3步走
- Tomcat本地服务器搭建
- Sybase 的convert函数
- 大数据征信的应用和启示:ZestFinance的基于大数据的信用评估技术
- 根据用户权限和角色拼接菜单