本文是基于Windows系统环境,学习和测试Series模块:
Windows 10
PyCharm 2018.3.5 for Windows (exe)
python 3.6.8 Windows x86 executable installer
from pandas import Series
info = Series([13, 'rose', True], index=['age', 'name', 'isStudent'])
info1 = Series([13, 'rose', True])
print(info)
print(info1)
from pandas import Series
info = Series([13, 'rose', True], index=['age', 'name', 'isStudent'])
print(info)
info = info.append(Series(['female'],index=['gender']))
info1 = info.append(Series(['female']))
print(info)
from pandas import Series
info = Series([13, 'rose', True], index=['age', 'name', 'isStudent'])
print(info)
info.drop('name')
print(info)
from pandas import Series
info = Series([13, 'rose', True], index=['age', 'name', 'isStudent'])
print(info)
info1 = info[13 != info.values]
info2 = info['rose' != info.values]
info3 = info[True != info.values]
print(info1)
print(info2)
print(info3)
from pandas import Series
info = Series([13, 'rose', True], index=['age', 'name', 'isStudent'])
print(info)
for index in info.index:
print(index, '=', info[index])