Curriculum
Course: Pandas
Login
Text lesson

Pandas as pd

Pandas is typically imported using the alias pd.

An alias in Python is an alternative name used to refer to the same object or entity.

You can create an alias by using the as keyword during the import process.

import pandas as pd

Now, the Pandas package can be referenced as pd instead of pandas.

Example

import pandas as pd

mydataset = {
  ‘cars’: [“BMW”“Volvo”“Ford”],
  ‘passings’[372]
}

myvar = pd.DataFrame(mydataset)

print(myvar)

Checking Pandas Version

The version number is stored in the __version__ attribute.

Example

import pandas as pd

print(pd.__version__)