标签:新手学习 学习 dex pam nas ups drop cups mil
1. 创建DataFrame
fruit = pd.DataFrame({‘Apple‘: [35, 41, 50], ‘Bananas‘: [21, 34, 10]}, index = [‘2017 Sales‘, ‘2018 Sales‘, ‘2019 Sales‘])
2. 创建Series
s2 = pd.Series([‘4 cups‘, ‘1 cup‘, ‘2 large‘, ‘1 can‘], index = [‘Flaver‘, ‘Milk‘, ‘Eggs‘, ‘Spam‘])
index默认为数组下标(0,1,2 ...)
删除
s2.drop(‘Milk‘)
修改
s2[‘Milk‘] = ‘3 cups‘
查找
s2[‘Milk‘]
标签:新手学习 学习 dex pam nas ups drop cups mil
原文地址:https://www.cnblogs.com/pf2018/p/8777939.html