共计 444 个字符,预计需要花费 2 分钟才能阅读完成。
提醒:本文最后更新于 2020-08-07 14:42,文中所关联的信息可能已发生改变,请知悉!
![Python 数据分析上的 8 个重要的知识点 Python 数据分析上的 8 个重要的知识点](https://shuidl.com/wp-content/uploads/2018/07/15326099909502bfd0ca98d.jpg)
一、列表推导式
![Python 数据分析上的 8 个重要的知识点 Python 数据分析上的 8 个重要的知识点](https://shuidl.com/wp-content/uploads/2018/07/1532609701384f06f5c54fc.jpg)
下面:
- 第一个例子是求每一个元素平方的的普通写法
- 第二个是列表推导式的写法。
![Python 数据分析上的 8 个重要的知识点 Python 数据分析上的 8 个重要的知识点](https://shuidl.com/wp-content/uploads/2018/07/15326097599984a684a40e6.jpg)
二、Lambda 函数
![Python 数据分析上的 8 个重要的知识点 Python 数据分析上的 8 个重要的知识点](https://shuidl.com/wp-content/uploads/2018/07/15326098392357a065c90d4.jpg)
![Python 数据分析上的 8 个重要的知识点 Python 数据分析上的 8 个重要的知识点](https://shuidl.com/wp-content/uploads/2020/08/788d7dfe8c9bd96.jpg)
Lambda 函数也是能做到的,
只要它们能够写成一行。
下面这个简单的例子能够让你更好的理解 Lambda 函数的强大之处
![Python 数据分析上的 8 个重要的知识点 Python 数据分析上的 8 个重要的知识点](https://shuidl.com/wp-content/uploads/2018/07/15326099437167510629333.jpg)
![Python 数据分析上的 8 个重要的知识点 Python 数据分析上的 8 个重要的知识点](https://shuidl.com/wp-content/uploads/2018/07/1532610013210900cc4165a.jpg)
三、Map 函数与 Filter 函数
![Python 数据分析上的 8 个重要的知识点 Python 数据分析上的 8 个重要的知识点](https://shuidl.com/wp-content/uploads/2018/07/153261006191172d57fa4cf.jpg)
![Python 数据分析上的 8 个重要的知识点 Python 数据分析上的 8 个重要的知识点](https://shuidl.com/wp-content/uploads/2018/07/1532610078158c2ed416f1e.jpg)
但是 filter 函数通过比较每一个元素是否为真从原始列表中抽取子集。
![Python 数据分析上的 8 个重要的知识点 Python 数据分析上的 8 个重要的知识点](https://shuidl.com/wp-content/uploads/2018/07/15326101358257c6b653101.jpg)
四、Arange 函数 和 Linspace 函数
![Python 数据分析上的 8 个重要的知识点 Python 数据分析上的 8 个重要的知识点](https://shuidl.com/wp-content/uploads/2018/07/153261024048850ee015b1b.jpg)
![Python 数据分析上的 8 个重要的知识点 Python 数据分析上的 8 个重要的知识点](https://shuidl.com/wp-content/uploads/2018/07/1532610267592e86935c606.jpg)
![Python 数据分析上的 8 个重要的知识点 Python 数据分析上的 8 个重要的知识点](https://shuidl.com/wp-content/uploads/2018/07/15326103086707d35d0ec31.jpg)
![Python 数据分析上的 8 个重要的知识点 Python 数据分析上的 8 个重要的知识点](https://shuidl.com/wp-content/uploads/2018/07/15326103310437bb3a04b40.jpg)
五、什么是轴 Axis
使用 Pandas 删除列或对 NumPy 矩阵元素求和时
你可能会遇到这个问题?
如果没有
那么之后也一定会遇到。
下面给出删除列的示例:
![Python 数据分析上的 8 个重要的知识点 Python 数据分析上的 8 个重要的知识点](https://shuidl.com/wp-content/uploads/2018/07/153261041562440609706cb.jpg)
![Python 数据分析上的 8 个重要的知识点 Python 数据分析上的 8 个重要的知识点](https://shuidl.com/wp-content/uploads/2018/07/1532610470072c352425a1e.jpg)
![Python 数据分析上的 8 个重要的知识点 Python 数据分析上的 8 个重要的知识点](https://shuidl.com/wp-content/uploads/2018/07/1532610487232976a37d0e9.jpg)
![Python 数据分析上的 8 个重要的知识点 Python 数据分析上的 8 个重要的知识点](https://shuidl.com/wp-content/uploads/2018/07/1532610545014e5c9c88369.jpg)
六、Concat 函数、Merge 函数和 Join 函数
![Python 数据分析上的 8 个重要的知识点 Python 数据分析上的 8 个重要的知识点](https://shuidl.com/wp-content/uploads/2018/07/153261064053917ba5cf62c.jpg)
![Python 数据分析上的 8 个重要的知识点 Python 数据分析上的 8 个重要的知识点](https://shuidl.com/wp-content/uploads/2018/07/153261064718253b6836b20.jpg)
![Python 数据分析上的 8 个重要的知识点 Python 数据分析上的 8 个重要的知识点](https://shuidl.com/wp-content/uploads/2018/07/153261065682269459dbbdc.jpg)
但是
它根据索引合并 dataframe,而不是某些指定列。
![Python 数据分析上的 8 个重要的知识点 Python 数据分析上的 8 个重要的知识点](https://shuidl.com/wp-content/uploads/2018/07/15326106895340c5dd64997.jpg)
![Python 数据分析上的 8 个重要的知识点 Python 数据分析上的 8 个重要的知识点](https://shuidl.com/wp-content/uploads/2018/07/1532610914426629959ee79.jpg)
七、Pandas 的 Apply 函数
![Python 数据分析上的 8 个重要的知识点 Python 数据分析上的 8 个重要的知识点](https://shuidl.com/wp-content/uploads/2018/07/15326107623233057aa9929.jpg)
八、Pivot Tables 数据透视表
![Python 数据分析上的 8 个重要的知识点 Python 数据分析上的 8 个重要的知识点](https://shuidl.com/wp-content/uploads/2018/07/1532610831125192be4a759.jpg)
正文完