1 Series
A: Objects that resemble one-dimensional arrays, each of which is composed of data labels associated with them
B: The left side of the build is indexed, and the default is 0.
1 from Pandas import Series,dataframe 2 as PD 3 4 obj=series ([4,7,-5,3])5 obj# Index on left value on right
C: You can get the representation of an array and the indexed object by using the values and index properties
1 4, 7,-5, 3], dtype=Int64)2 obj.index
d: Set index values
1 obj2=series ([4,7,-5,3],index=['d', ' b ','a','C'])2 obj23 obj2.index
e: Value is worth by index
1 obj2['a']2 obj2[['C',' a','d']]3 obj2[obj2>0 ]
F: If the data is in a Python dictionary, the series can be created directly from the dictionary
1 sdata={' ohio':35000,'Texas':71000 ,'Oregon':16000,'Utah': 2 obj3=Series (sdata)3 obj3
A very important feature in G:series is that it automatically matches the same index when multiple series operations are performed
1 #如果数据在Python字典中 can create a series directly from this dictionary.2sdata={'Ohio':35000,'Texas':7100,'Oregon': the,'Utah': the}3obj3=Series (sdata)4 obj35 6 #如果只是传入一个字典 The index in the result series is the dictionary key missing as Nan7states=['California','Ohio','Oregon','Texas']8Obj4=series (sdata,index=states)9 Ten #使用isnull notnull Judging missing values One A - #Series中一个非常重要的功能就是在算数运算中自动对其不同索引得数据 - obj3 the Obj4 -Obj3+obj4
There is a special attribute in H:series Name property
1 bj4.name='population'2 obj4.index.name=' State ' 3 OB
Using Python data to analyze the series of Panda Learning notes