python 统计文本单词数-字典排序
2016-02-16 17:32
609 查看
sorted(dict_1.items(),key=lambda asd:asd[1],reverse=True)
dict.items()返回一个list,其中每一项元素都是一个元组(key,value),
lambda匿名函数
asd[0]即键 ,1为值
相关文章推荐
- Python实现快速排序和插入排序算法及自定义排序的示例
- Python 基础教程 知识点总结
- Python基础02 基本数据类型
- python实现红包裂变算法
- python爬虫(二)之get请求
- python爬虫(一)
- python 文本处理(分割)
- python file模块 替换输入内容脚本
- IPython Notebook error - Unreadable Notebook: Unsupported JSON nbformat
- Install OpenCV 3.0 and Python 2.7+ on OSX
- Python基础篇【第2篇】: Python自定义函数
- python 内嵌函数, 闭包, 函数装饰器
- python根据路径导入模块的方法
- python练习之excel eval excelfile
- python3.0学习二 下载图片
- Python基础篇【第2篇】: Python内置函数(一)
- Python基础篇【第2篇】: Python文件操作
- Python基础篇【第1篇】: Python基础
- 使用python爬取csdn博客访问量
- python编程常用模板总结