(点击上方快速关注并设置为星标,一起学Python)
萧箫 发自 凹非寺
量子位 报道 | QbitAI
加载一个Jupyter插件后,无需写代码就能做数据分析,还帮你生成相应代码?
没错,只需要加载这个名为Mito的小工具包,用Python做数据分析,变得和用Excel一样简单:
运行速度比Excel更快,也不需要到处搜各种Python教程了。
好用如Excel,更快更全面
Mito是Jupyter notebook的一个可编辑电子表格插件,在编辑.csv表格(带格式转换功能)时,就能生成相关Python代码。
△Mito,线粒体Mitochondria的缩写
具体来说,Mito的出现,像是将Python的强大功能、和Excel的易用性进行了结合。
只需要掌握Excel的用法,就能使用Python的数据分析功能,还能将写出来的代码“打包带走”。
它弥补了Excel在数据分析上的几个缺陷:
-
Excel无法做大数据分析(大型数据集处理得不好)
-
Excel运行缓慢
-
Excel无法轻松创建可重复流程
同时,又比SQL和Python更简单、直观。毕竟这些专业工具对于0基础初学者来说,需要至少几年时间,才能完全上手。
据Mito内测用户表示,这款插件让他们用Python做数据分析的效率提升了10倍,因为用户可以直接在Mito里编写Excel公式,如=SUM(A1, 100)。
那么,Mito是怎么做到将Excel逻辑转换成Python代码的呢?
作者们编写了一种名为Transpiler的程序,有点类似于编译器的功能,采用抽象语法树(AST),解析Excel源代码,并转换成Python的源代码。
相比于采用专业软件如Alteryx(需要5000美元/月)进行数据分析,Mito所生成的Python代码可以根据需要自行修改,灵活性更高一点。
目前,Mito采用亚马逊云平台 (AWS)保存用户的相关数据,每个用户拥有一个独立账户。
当然,用户也可以选择将数据保存在本地。
自动生成Python代码
以分析美国各州的“家庭平均收入”和“允许托运的火车站数量”这两个数据的关系为例。
首先,上传“家庭平均收入”和“允许托运的火车站数量”两份数据。
数据处理的格式是.csv,当然也可以输入Excel文件,并用Mito转成两份.csv文件。
然后,将这两份数据集合并在一起,只需要用鼠标勾选对应功能、选中相关数据列就行。
啪!代码就生成好了。
然后,是做数据透视表,在完成分组后,采用聚合(aggregate)功能来切换聚合方法。
还包括数据过滤功能,同样立刻就能生成相关代码。
包含升降序排序功能,快速简洁。
然后就是相关数据统计、分析出结果了,流程直观。
保存分析文件的方法也很简单,文件是以Python编写的,而不是用比较难懂的VBA。
要想重复上面的步骤的话,也非常容易,Mito自带“重复已保存分析步骤”功能,一键就能用同样的方法分析其他数据。
确实要比一行行编写代码简单多了。
关于Mito
那么,Mito的作者们,为什么要搞这个软件?
因为他们发现,所谓的“几天上手Python数据分析”,其实根本没有那么容易……
初学者要想用Python搞数据分析,就得不停地查看各种文档、和求助于StackOverflow。
要想真正快速用Python分析数据,最后还得自己编写软件。
三位作者Aaron Diamond-Reivich、Jake Diamond-Reivich和Nate Rush都来自宾大,在学校期间,他们学习了计算机科学、统计学和商业分析相关的课程。
也正是在搞数据分析的时候,他们萌生了想要制作Mito的想法。
作者表示,软件目前还没有开源,因为他们还在思考,如何支持维护这个项目,并转到开源路径上来。
不过,它现在已经可以使用了。
感兴趣的小伙伴们,可以上手试试了~
项目主页:
https://trymito.io/launch
近期热门文章
-
30 行代码实现蚂蚁森林自动收能量(附送源码)
-
Linux 最常用命令:简单易学,但能解决 95% 以上的问题
-
2021了,最流行的密码依旧是123456
-
真香!用VS Code直接浏览GitHub代码 !
-
从万众期待到口碑扑街!唐探3令人失望,用Python来分析一下大家的评论
-
用Python分析了某大学2000千条表白墙,甜到发腻,原来脱单的秘密是……
-
值得收藏!20个Python奇技淫巧,让你受益匪浅!
-
这款IDEA插件刷爆了朋友圈,网友:这用起来有点酸爽~
-
央视最美记者王冰冰火爆B站,单个视频1800万播放,都说了啥?
<p data-darkmode-bgcolor-16072664870629="rgb(25, 25, 25)" data-darkmode-original-bgcolor-16072664870629="rgb(255, 255, 255)" data-darkmode-color-16072664870629="rgba(163, 163, 163, 0.9)" data-darkmode-original-color-16072664870629="rgba(230, 230, 230, 0.9)" data-darkmode-bgcolor-16073544711184="rgb(25, 25, 25)" data-darkmode-original-bgcolor-16073544711184="rgb(255, 255, 255)" data-darkmode-color-16073544711184="rgba(163, 163, 163, 0.9)" data-darkmode-original-color-16073544711184="rgba(230, 230, 230, 0.9)" data-darkmode-bgcolor-16114842087086="rgb(25, 25, 25)" data-darkmode-original-bgcolor-16114842087086="#fff|rgb(255, 255, 255)" data-darkmode-color-16114842087086="rgba(163, 163, 163, 0.9)" data-darkmode-original-color-16114842087086="#fff|rgba(230, 230, 230, 0.9)" style="max-width: 100%;min-height: 1em;box-sizing: border-box !important;overflow-wrap: break-word !important;"><br style="max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;" /></p><ul class="list-paddingleft-2" data-darkmode-bgcolor-16072664870629="rgb(25, 25, 25)" data-darkmode-original-bgcolor-16072664870629="rgb(255, 255, 255)" data-darkmode-color-16072664870629="rgba(163, 163, 163, 0.9)" data-darkmode-original-color-16072664870629="rgba(230, 230, 230, 0.9)" data-darkmode-bgcolor-16073544711184="rgb(25, 25, 25)" data-darkmode-original-bgcolor-16073544711184="rgb(255, 255, 255)" data-darkmode-color-16073544711184="rgba(163, 163, 163, 0.9)" data-darkmode-original-color-16073544711184="rgba(230, 230, 230, 0.9)" data-darkmode-bgcolor-16114842087086="rgb(25, 25, 25)" data-darkmode-original-bgcolor-16114842087086="#fff|rgb(255, 255, 255)" data-darkmode-color-16114842087086="rgba(163, 163, 163, 0.9)" data-darkmode-original-color-16114842087086="#fff|rgba(230, 230, 230, 0.9)" style="max-width: 100%;overflow-wrap: break-word !important;"><section data-tools="135编辑器" data-id="94250" data-darkmode-bgcolor-16072664870629="rgb(25, 25, 25)" data-darkmode-original-bgcolor-16072664870629="rgb(255, 255, 255)" data-darkmode-color-16072664870629="rgba(163, 163, 163, 0.9)" data-darkmode-original-color-16072664870629="rgba(230, 230, 230, 0.9)" data-darkmode-bgcolor-16073544711184="rgb(25, 25, 25)" data-darkmode-original-bgcolor-16073544711184="rgb(255, 255, 255)" data-darkmode-color-16073544711184="rgba(163, 163, 163, 0.9)" data-darkmode-original-color-16073544711184="rgba(230, 230, 230, 0.9)" data-darkmode-bgcolor-16114842087086="rgb(25, 25, 25)" data-darkmode-original-bgcolor-16114842087086="#fff|rgb(255, 255, 255)" data-darkmode-color-16114842087086="rgba(163, 163, 163, 0.9)" data-darkmode-original-color-16114842087086="#fff|rgba(230, 230, 230, 0.9)" style="max-width: 100%;font-variant-numeric: normal;font-variant-east-asian: normal;letter-spacing: 0.544px;line-height: 27.2px;border-width: 0px;border-style: none;border-color: initial;box-sizing: border-box !important;overflow-wrap: break-word !important;"><section data-tools="135编辑器" data-id="94250" data-darkmode-bgcolor-16072664870629="rgb(25, 25, 25)" data-darkmode-original-bgcolor-16072664870629="rgb(255, 255, 255)" data-darkmode-color-16072664870629="rgba(163, 163, 163, 0.9)" data-darkmode-original-color-16072664870629="rgba(230, 230, 230, 0.9)" data-darkmode-bgcolor-16073544711184="rgb(25, 25, 25)" data-darkmode-original-bgcolor-16073544711184="rgb(255, 255, 255)" data-darkmode-color-16073544711184="rgba(163, 163, 163, 0.9)" data-darkmode-original-color-16073544711184="rgba(230, 230, 230, 0.9)" data-darkmode-bgcolor-16114842087086="rgb(25, 25, 25)" data-darkmode-original-bgcolor-16114842087086="#fff|rgb(255, 255, 255)" data-darkmode-color-16114842087086="rgba(163, 163, 163, 0.9)" data-darkmode-original-color-16114842087086="#fff|rgba(230, 230, 230, 0.9)" style="max-width: 100%;letter-spacing: 0.544px;border-width: 0px;border-style: none;border-color: initial;box-sizing: border-box !important;overflow-wrap: break-word !important;"><section data-tools="135编辑器" data-id="94250" data-darkmode-bgcolor-16072664870629="rgb(25, 25, 25)" data-darkmode-original-bgcolor-16072664870629="rgb(255, 255, 255)" data-darkmode-color-16072664870629="rgba(163, 163, 163, 0.9)" data-darkmode-original-color-16072664870629="rgba(230, 230, 230, 0.9)" data-darkmode-bgcolor-16073544711184="rgb(25, 25, 25)" data-darkmode-original-bgcolor-16073544711184="rgb(255, 255, 255)" data-darkmode-color-16073544711184="rgba(163, 163, 163, 0.9)" data-darkmode-original-color-16073544711184="rgba(230, 230, 230, 0.9)" data-darkmode-bgcolor-16114842087086="rgb(25, 25, 25)" data-darkmode-original-bgcolor-16114842087086="#fff|rgb(255, 255, 255)" data-darkmode-color-16114842087086="rgba(163, 163, 163, 0.9)" data-darkmode-original-color-16114842087086="#fff|rgba(230, 230, 230, 0.9)" style="max-width: 100%;letter-spacing: 0.544px;border-width: 0px;border-style: none;border-color: initial;box-sizing: border-box !important;overflow-wrap: break-word !important;"><section data-darkmode-bgcolor-16072664870629="rgb(25, 25, 25)" data-darkmode-original-bgcolor-16072664870629="rgb(255, 255, 255)" data-darkmode-color-16072664870629="rgba(163, 163, 163, 0.9)" data-darkmode-original-color-16072664870629="rgba(230, 230, 230, 0.9)" data-darkmode-bgcolor-16073544711184="rgb(25, 25, 25)" data-darkmode-original-bgcolor-16073544711184="rgb(255, 255, 255)" data-darkmode-color-16073544711184="rgba(163, 163, 163, 0.9)" data-darkmode-original-color-16073544711184="rgba(230, 230, 230, 0.9)" data-darkmode-bgcolor-16114842087086="rgb(25, 25, 25)" data-darkmode-original-bgcolor-16114842087086="#fff|rgb(255, 255, 255)" data-darkmode-color-16114842087086="rgba(163, 163, 163, 0.9)" data-darkmode-original-color-16114842087086="#fff|rgba(230, 230, 230, 0.9)" style="max-width: 100%;border-width: 0px;border-style: none;border-color: initial;text-align: right;line-height: 1.75em;box-sizing: border-box !important;overflow-wrap: break-word !important;"><section data-darkmode-bgcolor-16072664870629="rgb(25, 25, 25)" data-darkmode-original-bgcolor-16072664870629="rgb(255, 255, 255)" data-darkmode-color-16072664870629="rgba(163, 163, 163, 0.9)" data-darkmode-original-color-16072664870629="rgba(230, 230, 230, 0.9)" data-darkmode-bgcolor-16073544711184="rgb(25, 25, 25)" data-darkmode-original-bgcolor-16073544711184="rgb(255, 255, 255)" data-darkmode-color-16073544711184="rgba(163, 163, 163, 0.9)" data-darkmode-original-color-16073544711184="rgba(230, 230, 230, 0.9)" data-darkmode-bgcolor-16114842087086="rgb(25, 25, 25)" data-darkmode-original-bgcolor-16114842087086="#fff|rgb(255, 255, 255)" data-darkmode-color-16114842087086="rgba(163, 163, 163, 0.9)" data-darkmode-original-color-16114842087086="#fff|rgba(230, 230, 230, 0.9)" style="max-width: 100%;display: inline-block;clear: both;box-sizing: border-box !important;overflow-wrap: break-word !important;"><section data-brushtype="text" data-darkmode-bgimage="1" data-style="padding: 18px 15px 20px 10px; background-size: 100% 100%; background-image: url('https://www.zkxjob.com/wp-content/uploads/2022/06/wxsync-2022-06-a2a8a5e1e58f30392066a170034ee027.png'); color: rgb(86, 146, 214); text-align: center; letter-spacing: 1.5px; background-repeat: no-repeat;" data-darkmode-bgcolor-16072664870629="rgb(25, 25, 25)" data-darkmode-original-bgcolor-16072664870629="rgb(255, 255, 255)" data-darkmode-color-16072664870629="rgba(163, 163, 163, 0.9)" data-darkmode-original-color-16072664870629="rgba(230, 230, 230, 0.9)" data-darkmode-bgimage-16072664870629="1" data-darkmode-bgcolor-16073544711184="rgb(25, 25, 25)" data-darkmode-original-bgcolor-16073544711184="rgb(255, 255, 255)" data-darkmode-color-16073544711184="rgba(163, 163, 163, 0.9)" data-darkmode-original-color-16073544711184="rgba(230, 230, 230, 0.9)" data-darkmode-bgimage-16073544711184="1" data-darkmode-bgcolor-16114842087086="rgb(25, 25, 25)" data-darkmode-original-bgcolor-16114842087086="#fff|rgb(255, 255, 255)" data-darkmode-color-16114842087086="rgb(86, 146, 214)" data-darkmode-original-color-16114842087086="#fff|rgba(230, 230, 230, 0.9)|rgb(86, 146, 214)" data-darkmode-bgimage-16114842087086="1" style="padding: 18px 15px 20px 10px;max-width: 100%;background-size: 100% 100%;background-image: url('https://www.zkxjob.com/wp-content/uploads/2022/06/wxsync-2022-06-a2a8a5e1e58f30392066a170034ee027.png');color: rgb(86, 146, 214);text-align: center;letter-spacing: 1.5px;background-repeat: no-repeat;box-sizing: border-box !important;overflow-wrap: break-word !important;"><section data-darkmode-bgimage="1" data-darkmode-bgcolor-16072664870629="rgb(25, 25, 25)" data-darkmode-original-bgcolor-16072664870629="rgb(255, 255, 255)" data-darkmode-color-16072664870629="rgba(163, 163, 163, 0.9)" data-darkmode-original-color-16072664870629="rgba(230, 230, 230, 0.9)" data-darkmode-bgimage-16072664870629="1" data-darkmode-bgcolor-16073544711184="rgb(25, 25, 25)" data-darkmode-original-bgcolor-16073544711184="rgb(255, 255, 255)" data-darkmode-color-16073544711184="rgba(163, 163, 163, 0.9)" data-darkmode-original-color-16073544711184="rgba(230, 230, 230, 0.9)" data-darkmode-bgimage-16073544711184="1" data-darkmode-bgcolor-16114842087086="rgb(25, 25, 25)" data-darkmode-original-bgcolor-16114842087086="#fff|rgb(255, 255, 255)" data-darkmode-color-16114842087086="rgb(86, 146, 214)" data-darkmode-original-color-16114842087086="#fff|rgba(230, 230, 230, 0.9)|rgb(86, 146, 214)" data-darkmode-bgimage-16114842087086="1" style="max-width: 100%;display: flex;justify-content: center;align-items: center;box-sizing: border-box !important;overflow-wrap: break-word !important;"><section data-darkmode-bgimage="1" data-darkmode-bgcolor-16072664870629="rgb(25, 25, 25)" data-darkmode-original-bgcolor-16072664870629="rgb(255, 255, 255)" data-darkmode-color-16072664870629="rgba(163, 163, 163, 0.9)" data-darkmode-original-color-16072664870629="rgba(230, 230, 230, 0.9)" data-darkmode-bgimage-16072664870629="1" data-darkmode-bgcolor-16073544711184="rgb(25, 25, 25)" data-darkmode-original-bgcolor-16073544711184="rgb(255, 255, 255)" data-darkmode-color-16073544711184="rgba(163, 163, 163, 0.9)" data-darkmode-original-color-16073544711184="rgba(230, 230, 230, 0.9)" data-darkmode-bgimage-16073544711184="1" data-darkmode-bgcolor-16114842087086="rgb(25, 25, 25)" data-darkmode-original-bgcolor-16114842087086="#fff|rgb(255, 255, 255)" data-darkmode-color-16114842087086="rgb(86, 146, 214)" data-darkmode-original-color-16114842087086="#fff|rgba(230, 230, 230, 0.9)|rgb(86, 146, 214)" data-darkmode-bgimage-16114842087086="1" style="margin-left: 2px;max-width: 100%;width: 20px;box-sizing: border-box !important;overflow-wrap: break-word !important;"></section><p data-darkmode-bgimage="1" data-darkmode-bgcolor-16072664870629="rgb(25, 25, 25)" data-darkmode-original-bgcolor-16072664870629="rgb(255, 255, 255)" data-darkmode-color-16072664870629="rgb(51, 51, 51)" data-darkmode-original-color-16072664870629="rgb(51, 51, 51)" data-darkmode-bgimage-16072664870629="1" data-darkmode-bgcolor-16073544711184="rgb(25, 25, 25)" data-darkmode-original-bgcolor-16073544711184="rgb(255, 255, 255)" data-darkmode-color-16073544711184="rgb(51, 51, 51)" data-darkmode-original-color-16073544711184="rgb(51, 51, 51)" data-darkmode-bgimage-16073544711184="1" data-darkmode-bgcolor-16114842087086="rgb(25, 25, 25)" data-darkmode-original-bgcolor-16114842087086="#fff|rgb(255, 255, 255)" data-darkmode-color-16114842087086="rgb(51, 51, 51)" data-darkmode-original-color-16114842087086="#fff|rgba(230, 230, 230, 0.9)|rgb(86, 146, 214)|rgb(51, 51, 51)" data-darkmode-bgimage-16114842087086="1" style="max-width: 100%;min-height: 1em;font-size: 14px;color: rgb(51, 51, 51);text-align: right;line-height: 1.5em;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span data-darkmode-bgimage="1" data-darkmode-bgcolor-16072664870629="rgb(25, 25, 25)" data-darkmode-original-bgcolor-16072664870629="rgb(255, 255, 255)" data-darkmode-color-16072664870629="rgb(51, 51, 51)" data-darkmode-original-color-16072664870629="rgb(51, 51, 51)" data-darkmode-bgimage-16072664870629="1" data-darkmode-bgcolor-16073544711184="rgb(25, 25, 25)" data-darkmode-original-bgcolor-16073544711184="rgb(255, 255, 255)" data-darkmode-color-16073544711184="rgb(51, 51, 51)" data-darkmode-original-color-16073544711184="rgb(51, 51, 51)" data-darkmode-bgimage-16073544711184="1" data-darkmode-bgcolor-16114842087086="rgb(25, 25, 25)" data-darkmode-original-bgcolor-16114842087086="#fff|rgb(255, 255, 255)" data-darkmode-color-16114842087086="rgb(51, 51, 51)" data-darkmode-original-color-16114842087086="#fff|rgba(230, 230, 230, 0.9)|rgb(86, 146, 214)|rgb(51, 51, 51)" data-darkmode-bgimage-16114842087086="1" style="max-width: 100%;font-family: 楷体, 楷体_GB2312, SimKai;letter-spacing: 0.5px;box-sizing: border-box !important;overflow-wrap: break-word !important;">你点的每个“在看”,我都认真当成了AI</span></p></section></section></section></section></section></section></section></ul>
本篇文章来源于: 菜鸟学Python
本文为原创文章,版权归知行编程网所有,欢迎分享本文,转载请保留出处!
你可能也喜欢
- ♥ Python处理Excel的方法——xlrd09/23
- ♥ django2 支持 python3 吗?11/02
- ♥ 深入理解Python随机数生成模块:random10/17
- ♥ 如何实现IDEA开发python?01/01
- ♥ 如何解决python文件中的中文乱码12/04
- ♥ python如何打包整个项目01/07
内容反馈