1. The most important thing in the pandas library is the variable-length dictionary (series) and the most important function of the series is alignment; that is, an index, a value in the form, as follows:
The series uses PD, which automatically adds an index to each value in the list, or you can specify the index yourself as follows:
I generated the dictionary in the form of a list, as follows:
You can change the format of Dictionary D with series as follows:
In addition, the series can also be added in the following manner as follows:
Index numbers are added together, different return Nan, and automatically align different index numbers
2, the name attribute in the series is also very important
' Order ' is a man-made name, student is the name of the whole M1, so it's efficient to deal with the problem!
3, Dataframe more powerful than series, series can only handle one-to-one, for a pair of more can not deal with, what meaning? As shown in the following:
As shown, for a one-to-many case series will be an error, but the use of dataframe will be handled particularly well!
Next, let's look at some of the basic operations of Dataframe:
The corresponding mapping is output by index. IX, and the elements can be changed;
To delete an operation
Like series, Dataframe can also add the name attribute to the index:
Add x, Y, z through columns
The pandas in Python