我在一个数据帧上的过程摘要。
train.damageDealt.sum()
# 581294667.8516002
train.damageDealt.shape
# (4446966,)
train.isnull().sum()
Id 0
groupId 0
matchId 0
assists 0
boosts 0
damageDealt 0
DBNOs 0
headshotKills 0
heals 0
killPlace 0
killPoints 0
kills 0
killStreaks 0
longestKill 0
matchDuration 0
matchType 0
maxPlace 0
numGroups 0
rankPoints 0
revives 0
rideDistance 0
roadKills 0
swimDistance 0
teamKills 0
vehicleDestroys 0
walkDistance 0
weaponsAcquired 0
winPoints 0
winPlacePerc 1
dtype: int64
train[train.winPlacePerc.isnull() == True].damageDealt
# 2744604 0.0
# Name: damageDealt, dtype: float64
dropna()
删除了该元组train2 = train.copy()
train2.dropna(inplace=True)
train2[train2.winPlacePerc.isnull() == True]
# Series([], Name: damageDealt, dtype: float64)
train2.damageDealt.sum()
# 581294667.8516004
所以我不知道当只删除了0.0元的DamageDealt列时,这个结果如何出现。 如果有人可以解释这一点将很有帮助。 在此先感谢!!