- Matplotlib 2.x By Example
- Allen Yu Claire Chung Aldrin Yim
- 80字
- 2025-02-25 04:40:37
pandas dataframe
A pandas dataframe is useful when we have some non-numerical labels or values in our matrix. It does not require homogeneous data, unlike Numpy. Columns can be named. There are also functions such as melt() and pivot_table() that add convenience in reshaping the table to facilitate analysis and plotting.
To convert a list into a pandas dataframe, we do the following:
import pandas as pd
pd.DataFrame(evens)
You can also convert a numpy array into a pandas dataframe.