Instagram
youtube
Facebook
Twitter

Inspecting a DataFrame

  • When we load a new DataFrame from a CSV, we want to know what it looks like.
  • If it is a small DataFrame, you can just simply use print(df) to display it.
  • If it's a large DataFrame, then it is required to inspect some of it items without having to look at the entire DataFrame.This can be done by using the method named .head() which will print the first 5 rows of that DataFrame and if you want to see more rows, you can simply do it by using the positional argument n, for instance, df.head(10) will print first 10 rows of the DataFrame.
  • The method df.info() gives some statistics for each column.