Advertisement
Sanlover

Untitled

Jul 14th, 2021
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. import pandas as pd
  2. import numpy as np
  3. import seaborn as sns
  4. from matplotlib import pyplot as plt
  5.  
  6. df = pd.read_csv('./vgsales.csv', encoding='latin-1')
  7.  
  8. var = df['Publisher'].value_counts().loc[lambda x: x > 831]
  9.  
  10. for index, row in df.iterrows():
  11. for tmp in var.index:
  12. if tmp == row["Publisher"]:
  13. df.at[index, "Publisher"] = "прочее"
  14.  
  15. print(df['Publisher'].value_counts())
  16.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement