Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Pandas Installation

Pandas Installation

Installing pandas requires Python as the base environment. Pandas is a Python-based library, so you need to install Python first, then install Pandas via Python's package manager, pip.

Install pandas using pip:

pip install pandas

After a successful installation, we can import the pandas package and use it:

import pandas

Example - check the pandas version

import

pandas

pandas.version  

Check the version

'1.1.5'

When importing pandas, the alias pd is generally used instead:

import pandas as pd

Example - check the pandas version

import

pandas

as

pd

pd.version  

Check the version

'1.1.5'

A simple pandas example:

Example

import

pandas

as

pd

mydataset

=

{

 

'sites'

:

[

"Google"

,

"Runoob"

,

"Wiki"

]

,

 

'number'

:

[

1

,

2

,

3

]

}

myvar

=

pd.

DataFrame

(

mydataset

)

print

(

myvar

)

The output of the code above is: