发布于2020-12-29 13:30 阅读(1051) 评论(0) 点赞(7) 收藏(0)
0
1
2
3
4
5
6
#https://www.kaggle.com/player8844/working-with-external-libraries/edit
kaggle course is a wonderful place to build up our fundamental ability !
numpy.random.randint(low = 1,high =5 ,size = 10) # 从1-5(不包括5,随机生成10个)
2: dir() (what can I do with it?)
&???
在这里插入图片描述
column name. 列名
row 行
pd.DataFrame([[30,21]] , columns = [‘Apples’ , ‘Bananas’])
fruits = pd.DataFrame({“Apples” : [30] , ‘Bananas’:[21]})
quantities = [‘4 cups’, ‘1 cup’, ‘2 large’, ‘1 can’]
items = [‘Flour’, ‘Milk’, ‘Eggs’, ‘Spam’]
recipe = pd.Series(quantities, index=items, name=‘Dinner’)
Both loc and iloc are row-first, column-second.
Both loc and iloc are row-first, column-second. This is the opposite of what we do in native Python, which is column-first, row-second.
& 且
| 或
loc 列或者行的 具体的名称
iloc 将表格视为 “矩阵”,表示索引的数值
axis = 1 等价于 axis = ‘columns’
#对每一行的元素进行某种操作》》》》/?????
Hint: Begin by writing a custom function that accepts a row from the DataFrame as input and returns the star rating corresponding to the row. Then, use DataFrame.apply to apply the custom function to every row in the dataset.
axis = 0 等价于 axis = “row”
groupby 这里重在理解,实在不行可以考虑去看看视频啥的
https://www.kaggle.com/player8844/grouping-and-sorting/edit
原文链接:https://blog.csdn.net/qq_42839893/article/details/111824790
0
1
2
3
4
5
作者:皇后娘娘别惹我
链接: https://www.pythonheidong.com/blog/article/727338/341586ebf166a4ec621e/
来源: python黑洞网
任何形式的转载都请注明出处,如有侵权 一经发现 必将追究其法律责任
昵称:
评论内容:(最多支持255个字符)
Copyright © 2018-2019 python黑洞网 All Rights Reserved 版权所有,并保留所有权利。 京ICP备18063182号-1
投诉与举报,广告合作请联系z452as@163.com或QQ3083709327
免责声明:网站文章均由用户上传,仅供读者学习交流使用,禁止用做商业用途。若文章涉及色情,反动,侵权等违法信息,请向我们举报,一经核实我们会立即删除!