[英]Drop all the rows having more than 5% NULL values in columns
我檢查了所有 NULL 值超過 5% 的列。 現在我想刪除這些列的所有行
代碼:
movies = movies.drop(movies[movies.isnull().sum(axis = 'index')/len(movies)*100 > 5],inplace = True)
print(movies)
我無法獲得預期的輸出。
你可以用thresh
df = df.dropna(axis=1 ,thresh = int(len(df)*0.95))
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.