新聞中心
在Pandas中,我們可以使用一些內(nèi)置的函數(shù)來進行運算,以下是一些常用的函數(shù):

1、計算最大值和最小值
max(): 返回Series或DataFrame中的最大值。
min(): 返回Series或DataFrame中的最小值。
2、計算平均值
mean(): 返回Series或DataFrame中的平均值。
3、計算總和
sum(): 返回Series或DataFrame中的總和。
4、計算標準差
std(): 返回Series或DataFrame中的標準差。
5、計算方差
var(): 返回Series或DataFrame中的方差。
6、計算四分位數(shù)
quantile(): 返回Series或DataFrame中的四分位數(shù)。
7、計算中位數(shù)
median(): 返回Series或DataFrame中的中位數(shù)。
8、計算眾數(shù)
mode(): 返回Series或DataFrame中的眾數(shù)。
9、計算偏度和峰度
skew(): 返回Series或DataFrame中的偏度。
kurt(): 返回Series或DataFrame中的峰度。
10、計算相關(guān)性
corr(): 返回Series或DataFrame中的元素之間的相關(guān)性。
11、數(shù)據(jù)清洗函數(shù)
dropna(): 刪除包含NaN值的行或列。
fillna(): 用指定的值填充NaN值。
replace(): 替換指定值。
astype(): 更改數(shù)據(jù)類型。
sort_values(): 根據(jù)指定列對數(shù)據(jù)進行排序。
reset_index(): 重置索引。
rename(): 重命名列名。
merge(): 合并兩個DataFrame。
concat(): 連接兩個或多個DataFrame。
groupby(): 根據(jù)指定列對數(shù)據(jù)進行分組。
新聞名稱:pandas引入函數(shù)運算
鏈接地址:http://m.fisionsoft.com.cn/article/djihjjd.html


咨詢
建站咨詢
