Study notes (07): Python data cleaning actual - value processing is repeated

Learning immediately: https://edu.csdn.net/course/play/26990/361133?utm_source=blogtoedu

1, the processing is repeated values

df[df.duplicated()]

np.sum(df.duplicated())

df.drop_duplicates()

df.drop_duplicates(subset= ['appname','size'],inplace=True)

To $ 8,000 and the $ ','

def f(x):

      if '$' in str(x):

         x = str(x).strip('$')

         x = str(x).replace(',','')

      else:

             x = str(x).replace(',','')

return float(x)

             

 

Released seven original articles · won praise 0 · Views 92

Guess you like

Origin blog.csdn.net/qq_42108777/article/details/104249808