Pandas
Pandas
Ignore “Warning” messages
Reference: Bot Bark; 2019
Basic
|
Skills
reference: 数据分析1480
NA count
|
Drop/Fill NA
|
idmax
|
Merging DataFrame
This is one of the most feature I like in pandas since it could automatically fill the missing value with NA.
Plus, when the DataFrame goes huge, pd.concat was way faster than dataframe merge in R.
Merge by columns
From:
|
Deleting rows by string-match
Sort
Select columns by features
|
str to integer (data type switch)
Reduce the RAM-consume
根据最大的类别筛选 DataFrame
split string to columns
str.contain
把 Series 里的列表转换为 DataFrame
用多个函数聚合
分组聚合
通过字典或Series进行分组
Connect to the matplotlib
more for plot()
Data Description: Summary and count
Count the number of elements in a column
More detials: Erik Marsja; 2020
Count the number of elelments and convert the result as a DataFrame
Read huge file with pandas
- check the size of the file:
1.4G test.csv 17504652 test.csv
- Check the normal reading time
8.875486135482788
It tacks 8.9s for it read a 1.4GB size file