Exploring Data using pandas

Premium

When you first load your data, it's important to perform initial checks to understand its structure, content, and the type of data it contains.

Viewing Data

Here's how you can take a peek at your DataFrame:

1# Display the first five rows of the stocks DataFrame
2print(stocks_df.head())
3
4# Display the last five rows of the sDataFrame
5print(stocks_df.tail())
6

Unlock Premium Content

Upgrade your account to access the full article, downloads, and exercises.

You'll get access to:

  • Access complete tutorials and examples
  • Download source code and resources
  • Follow along with practical exercises
  • Get in-depth explanations