pandas數據清洗相關

1.常用的數據操作函數

  1.df.dtypes  查看各列數據類型

      函數用法:df.dtypes

      注意:輸入df只能是DataFrame不能是一列,如df['time']

    

  2.astype  將某一列轉換爲指定類型

      函數用法:df['columns']=df['column'].astype('type')

      例:將time列由string(object)類型轉化爲int類型

     

  3.repalce  替換指定內容,可以使用正則表達式,一般用與數據整理