Home >Backend Development >Python Tutorial >How to import pandas in python
Pandas is a data analysis package for python. It was originally developed by AQR Capital Management in April 2008 and was open sourced at the end of 2009. It is currently continued to be developed and maintained by the PyData development team that focuses on Python data package development and belongs to PyData. part of the project.
Pandas was originally developed as a financial data analysis tool. Therefore, pandas provides good support for time series analysis. (Recommended learning: Python video tutorial)
The name of Pandas comes from panel data and python data analysis. Panel data is a term for multidimensional data sets in economics, and Pandas also provides the panel data type.
Data structure:
Series: one-dimensional array, similar to the one-dimensional array in Numpy. The two are also very similar to Python's basic data structure List. The difference is that the elements in List can be of different data types, while Array and Series only allow the storage of the same data type, which can use memory more efficiently. Improve computing efficiency.
Time- Series: Series indexed by time.
DataFrame: two-dimensional tabular data structure. Many functions are similar to data.frame in R. DataFrame can be understood as a container for Series. The following content is mainly based on DataFrame.
Panel: A three-dimensional array, which can be understood as a container of DataFrame.
Pandas has two unique basic data structures. Readers should note that it does have two data structures, because it is still a library of Python, so some data types in Python are still applicable here, and you can also use classes to define your own data types. However, Pandas defines two more data types: Series and DataFrame, which make data operations easier.
Because pandas is a third-party library for python, you need to install it before use. Directly use pip install pandas to automatically install pandas and related components.
Import the pandas module and use the alias. And import the Series module. The following usage is based on this import.
from pandas import Series import pandas as pd
For more Python related technical articles, please visit the Python Tutorial column to learn!
The above is the detailed content of How to import pandas in python. For more information, please follow other related articles on the PHP Chinese website!