3. 理解数据类型

  1. in[14]: movie = pd.read_csv('data/movie.csv')
  2. # 各列的类型
  3. in[15]: movie.dtypes
  4. out[15]: color object
  5. director_name object
  6. num_critic_for_reviews float64
  7. duration float64
  8. director_facebook_likes float64
  9. ...
  10. title_year float64
  11. actor_2_facebook_likes float64
  12. imdb_score float64
  13. aspect_ratio float64
  14. movie_facebook_likes int64
  15. Length: 28, dtype: object
  1. in[16]: # 显示各类型的数量
  2. movie.get_dtype_counts()
  3. out[16]: float64 13
  4. int64 3
  5. object 12
  6. dtype: int64