We know that the dictionary is an unordered data structure There exists mapping relation between its key and value However, the key and the value of dictionary are not independent while the data structure of Series in pandas is different It is equivalent to a fixed-length orderly dictionary Its index is independent from its value It has more powerful uses than the dictionary in some applications As the saying goes, "however strong you are, there's always someone stronger" As we just mentioned, the Series in pandas is an orderly fixed-length dictionary It's also similar to a one-dimensional array It consists of two parts in itself: data and index The way of creating it is quite simple Just use "pd.Series()", pd the alias of "pandas" module Enclosed in the parentheses are those data you want to generate Well, we see there are indexes before the results We see it is with indexes by default Sure, you may specify indexes by yourselves For instance, as we see, when defining it, we may write like this index = [1,2,3] Then, its new indexes are "1,2,3" It's the form we have specified We can view the index and values Since Series is similar to a dictionary it may, like a dictionary access data through the index and get the index value Sure, it may also use some basic operators as well as some functions to operate data For example, here, we multiply each data by 2 Compute the natural logarithm to the power of N Data alignment is an important use of Series Actually, data alignment can be achieved in a lot of data processing software like Excel Let's use an example to roughly explain it For example, here is a sheet with such records indexes in the front, followed by data What shall we do then To find data values corresponding to such indexes Well, here we see this and this item exist indeed It would be quite troublesome if we find them manually In Series, there is a corresponding use of data alignment For example, let's look at this example there is a dictionary "data" with three groups of data There is also a "sindex" which is index numbers indeed Then, if we use these two groups of data to generate a "Series" we will see this "AAPL" index here Actually, it does not exist in "data" So, the final result generated is like this The first lines are normal but in this line of "AAPL", it's NaN, meaning null NaN is an acronym of 3 words Guess what You may get it: Not a number It represents an undefined or inexpressible value Here, it may be understood as a missing value Surely, it may also be simply understood to be null We may use this function "isnull()" to test which values are null We see only this is True Let's look at this example The value of aSer is like this Inside it, "APPL" is null Let's look at another: bSer It is a dictionary It generates a Series, named "cSer" Let's add aSer and cSer Here, what can we see "AXP" exists in the original aSer and "CSCO" also exists but "CVX" does not So, if we add the two we can imagine aSer has four items and cSer, three items Of them, they share two items in common So, we see the final result is like this As for "AXP" and "CSCO" values corresponding to these two indexes do exist but others are null Well, that's the charm of the use of data alignment Quite convenient In particular, if the data quantity is great it would be highly efficient if we process it in such a step Since the type of all values in Series in this example is string the addition of aSer and cSer is just to join the two strings What if the values in raw data are of numeric type For example, let's change the values in the two Series to the numeric type and modify some of the values Suppose we're to acquire the average value of the two after alignment what should we do You might already know (aSer+cSer)/2, like this, will work, right As the values in the current Series are all of the numeric type the "+" sign here means addition of the numeric type which can bring us our desired result This is the Series data structure in pandas As we see, it's actually a one-dimensional sequence much like a dictionary It also has very powerful and convenient uses