
Python
分享python相关的实用技巧
花花呼呼
这个作者很懒,什么都没留下…
展开
-
学会使用Python的帮助
常用的三种方式:1. dir()主要用来查看对象的属性。>>> a = [1,2,3]>>> b = (1,2,3)>>> print dir(a)[..... 'append', 'count', 'extend',原创 2018-05-27 00:52:22 · 8118 阅读 · 0 评论 -
pandas之loc深度用法
1、loc 不仅可以输入数字也可以直接column名字,注意先行后列 df.loc[[0, 1, 10, 100], ['country', 'province', 'region_1', 'region_2']] 表示index(行)为0,1,10,100,列名为'country', 'province', 'region_1', 'region_2'。 2、 df.loc[df.coun...原创 2018-06-11 21:09:46 · 19252 阅读 · 3 评论 -
Pandas数据操作学习笔记
df.country.unique() 表示dataframe中的country列中没有重复的字段,也就是共有哪些国家df.country.value_counts() 统计country列中不同国家出现的次数表示dataframe中description列中每个字段是否含有tropical,注意map用法tropical_wine = df.description.map(lam...原创 2018-06-12 23:50:24 · 521 阅读 · 0 评论