Import Pandas Python

Chapter: Python Pandas Last Updated: 26-04-2021 17:22:18 UTC

Program:

            /* ............... START ............... */
                
import pandas as pd

data = {
  'name': ["Mark", "Peter", "John"],
  'age': [35, 32, 28]
}

values = pd.DataFrame(data)

print(values)
                /* ............... END ............... */
        

Output

    name  age
0   Mark   35
1  Peter   32
2   John   28

Notes:

  • Panda is python library and is used to analyze data.
  • By using the python code "import pandas" we can use Pandas Python library in our code.
  • Python pandas installation commmand - pip install pandas (This command will install pandas to our system).
  • Pandas is usually imported under the pd alias. (eg : import pandas as pd).

Tags

Pandas library in Python, import pandas as pd

Similar Programs Chapter Last Updated
Python create XML file from DataFrame Python Pandas 19-03-2023

1