【实操】 设有如下data数据,完成操作:
1 data = { 2 'animal': ['cat', 'cat', 'snake', 'dog', 'dog', 'cat', 'snake', 'cat', 'dog', 'dog'], 3 'age': [2.5, 3, 0.5, np.nan, 5, 2, 4.5, np.nan, 7, 3], 4 'visits': [1, 3, 2, 3, 2, 3, 1, 1, 2, 1], 5 'priority': ['yes', 'yes', 'no', 'yes', 'no', 'no', 'no', 'yes', 'no', 'no']} 67 labels = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']
创建DataFrame对象。 获取前三行的数据。 获取所有行,'animal'和'age'列。 获取3,4,8行,'animal'和'age'列。 获取 'visits'的值大于等于3的数据。 获取'animal'的值是’cat’的数据。 获取'age'不为空的数据。
您还不是超级VIP会员,不能查看作业,马上变身成为超级VIP会员