Your First Pandas Lab

PandasPandasBeginner
Practice Now

Introduction

Hi there, welcome to LabEx! In this first lab, you'll learn the classic "Hello, World!" program in Pandas.

Click the Continue button below to start the lab.


Skills Graph

%%%%{init: {'theme':'neutral'}}%%%% flowchart RL pandas(("`Pandas`")) -.-> pandas/ReadingDataGroup(["`Reading Data`"]) pandas(("`Pandas`")) -.-> pandas/DataSelectionGroup(["`Data Selection`"]) python(("`Python`")) -.-> python/ModulesandPackagesGroup(["`Modules and Packages`"]) python(("`Python`")) -.-> python/PythonStandardLibraryGroup(["`Python Standard Library`"]) python(("`Python`")) -.-> python/DataScienceandMachineLearningGroup(["`Data Science and Machine Learning`"]) pandas/ReadingDataGroup -.-> pandas/read_csv("`Read CSV`") pandas/DataSelectionGroup -.-> pandas/select_columns("`Select Columns`") pandas/DataSelectionGroup -.-> pandas/select_rows("`Select Rows`") python/ModulesandPackagesGroup -.-> python/importing_modules("`Importing Modules`") python/PythonStandardLibraryGroup -.-> python/data_collections("`Data Collections`") python/DataScienceandMachineLearningGroup -.-> python/data_analysis("`Data Analysis`") subgraph Lab Skills pandas/read_csv -.-> lab-92727{{"`Your First Pandas Lab`"}} pandas/select_columns -.-> lab-92727{{"`Your First Pandas Lab`"}} pandas/select_rows -.-> lab-92727{{"`Your First Pandas Lab`"}} python/importing_modules -.-> lab-92727{{"`Your First Pandas Lab`"}} python/data_collections -.-> lab-92727{{"`Your First Pandas Lab`"}} python/data_analysis -.-> lab-92727{{"`Your First Pandas Lab`"}} end

Hello Pandas

Let's start by importing the Pandas library. Open a new terminal and type:

python3
Python interpreter terminal window

This will open a Python interpreter. Now, let's import Pandas:

import pandas as pd

Pandas is now imported and ready to use. Let's create a DataFrame. We'll start with a simple list of numbers:

df = pd.DataFrame([10, 20, 30, 40], columns=['numbers'], index=['a', 'b', 'c', 'd'])

We can print the DataFrame by typing:

print(df)

Summary

Congratulations! You have completed your first LabEx Lab.

If you want to learn more about LabEx and how to use it, you can visit our Support Center . Or you can watch the video to learn more about LabEx.

Programming is a long journey, but Next Lab is just one click away. Let's do it!

Other Pandas Tutorials you may like