无限流 發表於 2026-1-6 09:02:17

一文带你掌握Python Pandas数据处理的三大实用技巧

<div id="navCategory"><h5 class="catalogue">目录</h5><ul class="first_class_ul"><li><a href="#_label0">一、如何对DataFrame新增列</a></li><ul class="second_class_ul"><li><a href="#_lab2_0_0">1.1 直接运算实现</a></li><li><a href="#_lab2_0_1">1.2 Apply方法增加列</a></li><li><a href="#_lab2_0_2">1.3 Assign方法</a></li><li><a href="#_lab2_0_3">1.3 通过条件语句进行新增列</a></li></ul><li><a href="#_label1">二、pandas常见的数据统计类型</a></li><ul class="second_class_ul"><li><a href="#_lab2_1_4">2.1 数据特征统计</a></li><li><a href="#_lab2_1_5">2.2 数据去重和分类汇总</a></li></ul><li><a href="#_label2">三、pandas对缺失值的处理</a></li><ul class="second_class_ul"><li><a href="#_lab2_2_6">3.1 判断是否为空值</a></li><li><a href="#_lab2_2_7">3.2 丢弃空行空列</a></li><li><a href="#_lab2_2_8">3.3 空值填充</a></li></ul><li><a href="#_label3">附录:Apply,Map,ApplyMap的使用差异</a></li><ul class="second_class_ul"></ul></ul></div><p>同样我们使用上节课的&nbsp;<code>DATA.xlsx</code>&nbsp;文件,来进行本节课的演示,数据如下:</p>
<p style="text-align:center"><img alt="" src="https://img.jbzj.com/file_images/article/202601/2026010609001260.png" /></p>
<p class="maodian"><a name="_label0"></a></p><h2>一、如何对DataFrame新增列</h2>
<p class="maodian"><a name="_lab2_0_0"></a></p><h3>1.1 直接运算实现</h3>
<p>我们新增一个&ldquo;<strong>业绩总分</strong>&rdquo; 列,为&ldquo;<strong>销售数量</strong>&rdquo; 乘以 &ldquo;<strong>客户评分</strong>&rdquo;</p>
<div class="jb51code"><pre class="brush:py;">print(df.head(3))
df.loc[:,"业绩总分"] = df["销售数量"] * df["客户评分"]
print("="*60)
print(df.head(3))
</pre></div>
<p>输出如下,可以发现运算过后,最后多了一列业绩总分,也就是成功新增了一列:</p>
<p style="text-align:center"><img alt="" src="https://img.jbzj.com/file_images/article/202601/2026010609001237.png" /></p>
<p class="maodian"><a name="_lab2_0_1"></a></p><h3>1.2 Apply方法增加列</h3>
<p><code>apply</code>方法的直接使用用法是这样,这里我们通过<code>performance</code>函数接受<code>df</code>,然后进行判断,根据不同的安全等级划分性能</p>
<div class="jb51code"><pre class="brush:py;">def performance(df):
    if df["安全等级"] == "A" or df["安全等级"] == "B":
      return "好"
    elif df["安全等级"] == "C" or df["安全等级"] == "D":
      return "一般"

# axis=1 表示一行一行处理数据, 如果是一列一列处理数据的话就是 axis=0
df.loc[:,"性能"] = df.apply(performance,axis=1)
print(df.head(3))
</pre></div>
<p>输出结果如下,可以看到通过<code>apply</code>方法,我们也成功增加了一列性能:</p>
<blockquote><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 产品经理 &nbsp;产品类别 &nbsp;地区 安全等级 &nbsp;销售额(元) &nbsp;销售数量 &nbsp;客户评分 &nbsp;性能<br />出库日期<br />2023-06-01 &nbsp; &nbsp; &nbsp; Jerry &nbsp;电子产品 &nbsp;西南 &nbsp; &nbsp;C &nbsp;3789.6 &nbsp; &nbsp;12 &nbsp; 5.0 &nbsp;一般<br />2023-06-02 &nbsp; &nbsp; &nbsp; &nbsp;Cary &nbsp; &nbsp;服装 &nbsp;华东 &nbsp; &nbsp;A &nbsp;2345.3 &nbsp; &nbsp;14 &nbsp; 5.0 &nbsp; 好<br />2023-06-03 &nbsp; Bob-Smith &nbsp;家居用品 &nbsp;西北 &nbsp; &nbsp;D &nbsp; 567.8 &nbsp; &nbsp; 7 &nbsp; 3.7 &nbsp;一般</p></blockquote>
<p>还可以顺手通过<code>value_counts()</code>方法统计一下结果:</p>
<div class="jb51code"><pre class="brush:py;">print(df["性能"].value_counts()) # 统计不同性能情况的个数
</pre></div>
<p>如果python基础好的话,还可以通过推导式,简化一下函数的写法:</p>
<div class="jb51code"><pre class="brush:py;">df["性能"] = df["安全等级"].apply(lambda x: "好" if x in ["A","B"] else "一般")
</pre></div>
<p>同时发现<code>apply</code>方法有一个<code>axis</code>参数,表示传入进来的<code>df</code>是按行,还是按列,如果为1,代表为行,其实打印出来就发现</p>
<p style="text-align:center"><img alt="" src="https://img.jbzj.com/file_images/article/202601/2026010609001236.png" /></p>
<p>结构其实是上面这样子,因此可以通过<code>df[&quot;XXXX&quot;]</code> 的形式取出来做判断,然后再返回一个结果,如果<code>axis=0</code>,那代表的就是按列传递,其实每此传递都是 <strong>一列索引+一列数据</strong> 的格式,这种情况下我们可以对每列的数据做分析,结构如下:</p>
<p style="text-align:center"><img alt="" src="https://img.jbzj.com/file_images/article/202601/2026010609001293.png" /></p>
<p class="maodian"><a name="_lab2_0_2"></a></p><h3>1.3 Assign方法</h3>
<p>同时我们也可以使用<code>Assign</code>方法得到一样的结果,下面不管是 <code>map</code> 还是多加的<code>[ ]</code>,都是为了将数据一行一行取出来,具体<code>map</code>和<code>apply</code> 这些方法怎么用,我会在最后一节,附录中给出来</p>
<div class="jb51code"><pre class="brush:py;"># 第一种写法
df = df.assign(性能 = df["安全等级"].map(lambda x: "好" if x in ["A", "B"] else "一般"))
# 第二种写法
df = df.assign(性能 = lambda x: ["好" if x in ["A", "B"] else "一般" for x in df["安全等级"]])
print(df.head(3))
</pre></div>
<p>因此我们可以得到结果是:</p>
<blockquote><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;产品经理 &nbsp;产品类别 &nbsp;地区 安全等级 &nbsp;销售额(元) &nbsp;销售数量 &nbsp;客户评分 &nbsp;性能<br />出库日期<br />2023-06-01 &nbsp; &nbsp; &nbsp;Jerry &nbsp;电子产品 &nbsp;西南 &nbsp; &nbsp;C &nbsp;3789.6 &nbsp; &nbsp;12 &nbsp; 5.0 &nbsp;一般<br />2023-06-02 &nbsp; &nbsp; &nbsp; Cary &nbsp; &nbsp;服装 &nbsp;华东 &nbsp; &nbsp;A &nbsp;2345.3 &nbsp; &nbsp;14 &nbsp; 5.0 &nbsp; 好<br />2023-06-03 &nbsp;Bob-Smith &nbsp;家居用品 &nbsp;西北 &nbsp; &nbsp;D &nbsp; 567.8 &nbsp; &nbsp; 7 &nbsp; 3.7 &nbsp;一般</p></blockquote>
<p class="maodian"><a name="_lab2_0_3"></a></p><h3>1.3 通过条件语句进行新增列</h3>
<p>在下面的代码中,我们先通过 <code>df[&quot;性能&quot;] = &quot;&quot;</code> 初始化一个空列,然后依次赋值,可以得到一样的结果:</p>
<div class="jb51code"><pre class="brush:py;">df["性能"] = "" # 先初始化一个空列
df.loc.isin(["A","B"]),"性能"] = "好"
df.loc.isin(["C","D"]),"性能"] = "一般"
print(df.head(3))
</pre></div>
<p class="maodian"><a name="_label1"></a></p><h2>二、pandas常见的数据统计类型</h2>
<p class="maodian"><a name="_lab2_1_4"></a></p><h3>2.1 数据特征统计</h3>
<p><code>pandas</code>提供了非常强大的数据统计功能,比如去重,计数以及对数据特征做汇总,比如我们先简单使用这样一句代码:</p>
<div class="jb51code"><pre class="brush:py;">print(df.describe()) # 描述性统计
</pre></div>
<p>描述性统计用于数据中的数值列计数,求平均值,标准差,最小最大值和各个分位数</p>
<blockquote><p>&nbsp; &nbsp; &nbsp; &nbsp;销售额(元) &nbsp; &nbsp; 销售数量 &nbsp; &nbsp; &nbsp;客户评分<br />count &nbsp; 606.000000 &nbsp;606.000000 &nbsp;606.000000<br />mean &nbsp; 1381.760479 &nbsp; &nbsp;7.120462 &nbsp; &nbsp;4.327723<br />std &nbsp; &nbsp; 868.101509 &nbsp; &nbsp;3.309942 &nbsp; &nbsp;0.390114<br />min &nbsp; &nbsp; 345.600000 &nbsp; &nbsp;2.000000 &nbsp; &nbsp;3.500000<br />25% &nbsp; &nbsp; 745.600000 &nbsp; &nbsp;5.000000 &nbsp; &nbsp;4.000000<br />50% &nbsp; &nbsp; 987.600000 &nbsp; &nbsp;6.000000 &nbsp; &nbsp;4.300000<br />75% &nbsp; &nbsp;1876.400000 &nbsp; &nbsp;8.000000 &nbsp; &nbsp;4.600000<br />max &nbsp; &nbsp;4567.900000 &nbsp; 21.000000 &nbsp; &nbsp;5.000000</p></blockquote>
<p>当然如果你只想要查看某个字段的具体指标的话,可以通过单独打印实现:</p>
<div class="jb51code"><pre class="brush:py;">print(df["销售额(元)"].max()) # 最大销售额
print(df["销售额(元)"].min()) # 最小销售额
print(df["销售额(元)"].mean()) # 平均销售额
print(df["销售额(元)"].median()) # 中位数销售额

print(df[["销售额(元)","销售数量"]].cov()) # 协方差矩阵
print(df[["销售额(元)","销售数量"]].corr()) # 相关系数矩阵
</pre></div>
<p class="maodian"><a name="_lab2_1_5"></a></p><h3>2.2 数据去重和分类汇总</h3>
<p>通过 <code>unique</code>方法 我们能拿到去重之后的结果,返回的是一个列表,而通过 <code>value_counts</code> 我们能拿到各个子类的结果</p>
<div class="jb51code"><pre class="brush:py;">print(df["安全等级"].unique())
print(df["安全等级"].value_counts())
print("="*60) # 分割线
print(df["地区"].unique())
print(df["地区"].value_counts())
</pre></div>
<p>输出的结果如下:</p>
<blockquote><p>[&#39;C&#39; &#39;A&#39; &#39;D&#39; &#39;B&#39;]<br />安全等级<br />C &nbsp; &nbsp;175<br />A &nbsp; &nbsp;147<br />B &nbsp; &nbsp;146<br />D &nbsp; &nbsp;138<br />Name: count, dtype: int64<br />============================================================<br />[&#39;西南&#39; &#39;华东&#39; &#39;西北&#39; &#39;华北&#39; &#39;华南&#39; &#39;华中&#39;]<br />地区<br />华东 &nbsp; &nbsp;102<br />西南 &nbsp; &nbsp;101<br />华北 &nbsp; &nbsp;101<br />华南 &nbsp; &nbsp;101<br />华中 &nbsp; &nbsp;101<br />西北 &nbsp; &nbsp;100<br />Name: count, dtype: int64</p></blockquote>
<p class="maodian"><a name="_label2"></a></p><h2>三、pandas对缺失值的处理</h2>
<p>我们有一个这样的EXCEL文件,名为 <code>DATA_part.xlsx</code>,如图所示,这个数据很不规范,有以下几个典型特征:</p>
<ul><li>A1单元格为空,真正的数值前有空行空列</li><li>存在合并单元格</li><li>数据源中也存在空行</li></ul>
<p style="text-align:center"><img alt="" src="https://img.jbzj.com/file_images/article/202601/2026010609001235.png" /></p>
<p class="maodian"><a name="_lab2_2_6"></a></p><h3>3.1 判断是否为空值</h3>
<p>首先我们读取这个EXCEL,使用<code>skiprows</code> 跳过第一行</p>
<div class="jb51code"><pre class="brush:py;">file_path = r"C:\Users\22330\Desktop\进行中\DATA_part.xlsx"
df = pd.read_excel(file_path,skiprows=1) # 跳过第一行
</pre></div>
<p>得到如下的结果,可以发现没有填充数据的部分都是<code>NaN</code>,因此我们需要对数据进行清洗</p>
<blockquote><p>&nbsp; &nbsp;Unnamed: 0 &nbsp; &nbsp; &nbsp; 产品经理 &nbsp; 地区 &nbsp;销售数量 &nbsp;客户评分<br />0 &nbsp; &nbsp; &nbsp; &nbsp; NaN &nbsp; &nbsp; &nbsp;Jerry &nbsp; 西南 &nbsp;12.0 &nbsp; 5.0<br />1 &nbsp; &nbsp; &nbsp; &nbsp; NaN &nbsp; &nbsp; &nbsp; &nbsp;NaN &nbsp; 华东 &nbsp;14.0 &nbsp; 5.0<br />2 &nbsp; &nbsp; &nbsp; &nbsp; NaN &nbsp; &nbsp; &nbsp; &nbsp;NaN &nbsp; 西北 &nbsp; 7.0 &nbsp; 3.7<br />3 &nbsp; &nbsp; &nbsp; &nbsp; NaN &nbsp; &nbsp; &nbsp; &nbsp;NaN &nbsp;NaN &nbsp; NaN &nbsp; NaN<br />4 &nbsp; &nbsp; &nbsp; &nbsp; NaN &nbsp; &nbsp; &nbsp; Cary &nbsp; 西南 &nbsp;17.0 &nbsp; NaN<br />5 &nbsp; &nbsp; &nbsp; &nbsp; NaN &nbsp; &nbsp; &nbsp; &nbsp;NaN &nbsp; 华东 &nbsp;19.0 &nbsp;10.0<br />6 &nbsp; &nbsp; &nbsp; &nbsp; NaN &nbsp; &nbsp; &nbsp; &nbsp;NaN &nbsp; 西北 &nbsp;12.0 &nbsp; 8.7<br />7 &nbsp; &nbsp; &nbsp; &nbsp; NaN &nbsp;Bob-Smith &nbsp; 西南 &nbsp;15.0 &nbsp; 8.0<br />8 &nbsp; &nbsp; &nbsp; &nbsp; NaN &nbsp; &nbsp; &nbsp; &nbsp;NaN &nbsp; 华东 &nbsp;17.0 &nbsp; 8.0<br />9 &nbsp; &nbsp; &nbsp; &nbsp; NaN &nbsp; &nbsp; &nbsp; &nbsp;NaN &nbsp; 西北 &nbsp;10.0 &nbsp; 6.7</p></blockquote>
<p>首先我们通过<code>isnull</code>来判断是否是空值,注意两层<code>sum</code>才是对整个区域的缺失值求和</p>
<div class="jb51code"><pre class="brush:py;">print(df.isnull()) # 打印缺失值
print("="*60) # 分割线
print(df.isnull().sum()) # 查看缺失值数量
print("="*60) # 分割线
print(df.isnull().sum().sum()) # 查看缺失值总数
</pre></div>
<p>得到如下结果:</p>
<blockquote><p>&nbsp; &nbsp;Unnamed: 0 &nbsp; 产品经理 &nbsp; &nbsp; 地区 &nbsp; 销售数量 &nbsp; 客户评分<br />0 &nbsp; &nbsp; &nbsp; &nbsp;True &nbsp;False &nbsp;False &nbsp;False &nbsp;False<br />1 &nbsp; &nbsp; &nbsp; &nbsp;True &nbsp; True &nbsp;False &nbsp;False &nbsp;False<br />2 &nbsp; &nbsp; &nbsp; &nbsp;True &nbsp; True &nbsp;False &nbsp;False &nbsp;False<br />3 &nbsp; &nbsp; &nbsp; &nbsp;True &nbsp; True &nbsp; True &nbsp; True &nbsp; True<br />4 &nbsp; &nbsp; &nbsp; &nbsp;True &nbsp;False &nbsp;False &nbsp;False &nbsp; True<br />5 &nbsp; &nbsp; &nbsp; &nbsp;True &nbsp; True &nbsp;False &nbsp;False &nbsp;False<br />6 &nbsp; &nbsp; &nbsp; &nbsp;True &nbsp; True &nbsp;False &nbsp;False &nbsp;False<br />============================================================<br />Unnamed: 0 &nbsp; &nbsp;7<br />产品经理 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;5<br />地区 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1<br />销售数量 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1<br />客户评分 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2<br />dtype: int64<br />============================================================<br />16</p></blockquote>
<p>同样如果我们需要统计非空值,那就使用<code>notnull</code>方法。</p>
<p class="maodian"><a name="_lab2_2_7"></a></p><h3>3.2 丢弃空行空列</h3>
<p>在这里我们需要使用<code>dropna</code>方法,里面主要有三个参数:</p>
<ul><li><code>axis=1</code> , 代表按列方向,<code>axis=0</code> , 代表按行方向</li><li><code>how=&quot;all&quot;</code> 代表这个维度所有的为空才删除,<code>how=&quot;any&quot;</code>代表只要有空值就删除</li><li><code>inplace=True</code> 代表替换原来的DataFrame,否则不替换</li></ul>
<div class="jb51code"><pre class="brush:py;">df.dropna(axis=1,how="all",inplace=True) # 按列删除缺失值
df.dropna(axis=0,how="all",inplace=True) # 按行删除缺失值
</pre></div>
<p>执行以上过程后,得到稍微干净一点的数据:</p>
<blockquote><p>&nbsp; &nbsp; 产品经理 &nbsp;地区 &nbsp;销售数量 &nbsp;客户评分<br />0 &nbsp;Jerry &nbsp;西南 &nbsp;12.0 &nbsp; 5.0<br />1 &nbsp; &nbsp;NaN &nbsp;华东 &nbsp;14.0 &nbsp; 5.0<br />2 &nbsp; &nbsp;NaN &nbsp;西北 &nbsp; 7.0 &nbsp; 3.7<br />4 &nbsp; Cary &nbsp;西南 &nbsp;17.0 &nbsp; NaN<br />5 &nbsp; &nbsp;NaN &nbsp;华东 &nbsp;19.0 &nbsp;10.0<br />6 &nbsp; &nbsp;NaN &nbsp;西北 &nbsp;12.0 &nbsp; 8.7</p></blockquote>
<p class="maodian"><a name="_lab2_2_8"></a></p><h3>3.3 空值填充</h3>
<p>接下来我们就需要对剩余的空值进行处理,规范的DataFrame其实就是行和列每个位置都有有效的数据,因此我们通过<code>fillna</code>方法将其进行填充,其重要的主要有3个参数:</p>
<ul><li><code>value</code> , 代表你要将空值填为什么,比如对于客户评分列就很适合这种填充</li><li><code>method=&quot;ffill&quot;</code> 代表用空值之前的内容填充,比如产品经理列就很适合,同样<code>bfill</code>代表用空值后续的值填充</li><li><code>inplace=True</code> 代表替换原来的DataFrame,否则不替换</li></ul>
<div class="jb51code"><pre class="brush:py;">df["客户评分"].fillna(value=0,inplace=True) # 填充缺失值
df["产品经理"].fillna(method="ffill",inplace=True) # 填充缺失值
</pre></div>
<p>经过这样处理之后,得到的结果为:</p>
<blockquote><p>&nbsp; &nbsp; 产品经理 &nbsp;地区 &nbsp;销售数量 &nbsp;客户评分<br />0 &nbsp;Jerry &nbsp;西南 &nbsp;12.0 &nbsp; 5.0<br />1 &nbsp;Jerry &nbsp;华东 &nbsp;14.0 &nbsp; 5.0<br />2 &nbsp;Jerry &nbsp;西北 &nbsp; 7.0 &nbsp; 3.7<br />4 &nbsp; Cary &nbsp;西南 &nbsp;17.0 &nbsp; 0.0<br />5 &nbsp; Cary &nbsp;华东 &nbsp;19.0 &nbsp;10.0<br />6 &nbsp; Cary &nbsp;西北 &nbsp;12.0 &nbsp; 8.7</p></blockquote>
<p>这样子我们再直接写到另一个工作簿,就非常完美了,但是要注意使用<code>index=False</code>,防止将DataFrame的索引列也写回。</p>
<div class="jb51code"><pre class="brush:py;">df.to_excel(r"C:\Users\22330\Desktop\进行中\DATA_part_clean.xlsx",index=False) # 保存到新文件
</pre></div>
<p>我们打开保存之后的<code>DATA_part_clean.xlsx</code>文件,就发现清洗后的数据已经放在表格内了</p>
<p style="text-align:center"><img alt="" src="https://img.jbzj.com/file_images/article/202601/2026010609001292.png" /></p>
<p class="maodian"><a name="_label3"></a></p><h2>附录:Apply,Map,ApplyMap的使用差异</h2>
<p>在下面的案例中,我们需要将 <code>&quot;A&quot;:&quot;区域A&quot;,&quot;B&quot;:&quot;区域B&quot;,&quot;C&quot;:&quot;区域C&quot;</code> 做一个一一替换,使用了四种不同的方式,都能得到最后的结果:</p>
<ul><li><code>apply</code> 方法,结合lambda函数,取出字典中的值,然后写回</li><li><code>applymap</code> 方法,遍历整个DataFrame,发现有符合的键,则进行相应的值替换,但是需要注意此方法只适用于<code>DataFrame</code></li><li><code>map</code> 方法,既可以支持<code>DataFrame</code> 又可以支持<code>Series</code></li><li><code>replace</code> 方法,取出对应的列索引,然后进行字典替换</li></ul>
<div class="jb51code"><pre class="brush:py;">import pandas as pd
import numpy as np
import random

np.random.seed(42) # 固定随机数种子
random.seed(42)
df = pd.DataFrame({
    "name":np.random.choice(["John","Doe","Jane"],20),
    "area":np.random.choice(["A","B","C"],20),
    "spend":np.random.randint(18,60,20),
    "perf":np.random.randint(1,100,20)
})
print(df.head(3))
print("="*30)
map_dict = {"A":"区域A","B":"区域B","C":"区域C"}
df["area"] = df["area"].apply(lambda x:map_dict) # 采用apply方法进行替换
df = df.applymap(lambda x:map_dict if x in map_dict else x) # 使用applymap方法进行替换
# df["area"] = df["area"].applymap(lambda x:map_dict) # 这样写是错的,applymap只能对DataFrame生效
df["area"] = df["area"].map(map_dict)# 使用map方法进行替换,对Series进行替换
df = df.map(lambda x:map_dict if x in map_dict else x) # 对整个DataFrame进行替换
df = df.replace({"area":map_dict}) # 采用replace方法替换area列的A、B、C
print(df.head(3))
</pre></div>
<p>上述几种方法得到的结果都是,实现了对指定列的替换:</p>
<blockquote><p>&nbsp; &nbsp;name area &nbsp;spend &nbsp;perf<br />0 &nbsp;Jane &nbsp; &nbsp;A &nbsp; &nbsp; 54 &nbsp; &nbsp;50<br />1 &nbsp;John &nbsp; &nbsp;A &nbsp; &nbsp; 24 &nbsp; &nbsp; 4<br />2 &nbsp;Jane &nbsp; &nbsp;B &nbsp; &nbsp; 38 &nbsp; &nbsp; 2<br />==============================<br />&nbsp; &nbsp;name area &nbsp;spend &nbsp;perf<br />0 &nbsp;Jane &nbsp;区域A &nbsp; &nbsp; 54 &nbsp; &nbsp;50<br />1 &nbsp;John &nbsp;区域A &nbsp; &nbsp; 24 &nbsp; &nbsp; 4<br />2 &nbsp;Jane &nbsp;区域B &nbsp; &nbsp; 38 &nbsp; &nbsp; 2</p></blockquote>
頁: [1]
查看完整版本: 一文带你掌握Python Pandas数据处理的三大实用技巧