python中items函数_Python pandas.DataFrame.items函数方法的使用
DataFrame.items(self) [source]
迭代器遍历(列名,Series)对。
遍历DataFrame列,返回一个具有列名称和内容为Series的元组。
Yields:label: 对象
要迭代的DataFrame的列名。
content: Series
属于每个标签的列条目(作为Series)。
例子>>> df = pd.DataFrame({'species': ['bear', 'bear', 'marsupial'],
... 'population': [1864, 22000, 80000]},
... index=['panda', 'polar', 'koala'])
>>> df
species population
panda bear 1864
polar bear 22000
koala marsupial 80000
>>> for label, content in df.items():
... print('label:', label)
... print('content:', content, sep='\n')
...
label: species
content:
panda bear
polar bear
koala marsupial
Name: species, dtype: object
label: population
content:
panda 1864
polar 22000
koala 80000
Name: population, dtype: int64
python中items函数_Python pandas.DataFrame.items函数方法的使用相关推荐
- python dataframe loc函数_python pandas.DataFrame.loc函数使用详解
官方函数 DataFrame.loc Access a group of rows and columns by label(s) or a boolean array. .loc[] is prim ...
- python数据去重的函数_python pandas dataframe 去重函数的具体使用
今天笔者想对pandas中的行进行去重操作,找了好久,才找到相关的函数 先看一个小例子 from pandas import Series, DataFrame data = DataFrame({' ...
- python convert函数_Python pandas.DataFrame.tz_convert函数方法的使用
DataFrame.tz_convert(tz, axis=0, level=None, copy=True)[source] 将tz-aware axis转换为目标时区. 参数:tz:str或 tz ...
- python中cumsum函数_Python pandas.DataFrame.cumsum函数方法的使用
DataFrame.cumsum(self, axis=None, skipna=True, *args, **kwargs) 返回DataFrame或Series轴上的累计和. 返回包含累计和的相同 ...
- python中where函数_Python pandas.DataFrame.where函数方法的使用
DataFrame.where(cond, other=nan, inplace=False, axis=None, level=None, errors='raise', try_cast=Fals ...
- python resample函数_Python pandas.DataFrame.resample函数方法的使用
DataFrame.resample(rule, axis=0, closed=None, label=None, convention='start', kind=None, loffset=Non ...
- python iloc函数_Python pandas.DataFrame.iloc函数方法的使用
DataFrame.iloc 纯粹基于整数位置的索引,用于按位置选择. .iloc[] 主要是基于整数位置(从轴的0到长度-1),但也可以与布尔数组一起使用. 允许的输入:整数, 例如, 5 整数的列 ...
- python describe函数_Python pandas.DataFrame.describe函数方法的使用
DataFrame.describe(self, percentiles=None, include=None, exclude=None) 生成描述性统计数据,总结数据集分布的集中趋势,分散和形状, ...
- python agg函数_Python pandas.DataFrame.agg函数方法的使用
DataFrame.agg(func, axis=0, *args, **kwargs) 使用指定axis上的一个或多个操作Aggregate. 参数:func: function, str, lis ...
最新文章
- 全球及中国综艺节目产业营销策略分析及创新格局规划建议报告2021-2027年
- ERROR: Start Page at 'www/index.html' was not found
- 知道python测试答案_大数据分析的python基础知道章节测试答案
- oracle静默文件建库,【配置上线】Oracle静默建库 for 11g
- linux jar和zip,Linux命令———zip和jar文件压缩解压
- java猜数游戏有次数限制_“去小学化”之后,可以这样开展数学游戏,让孩子玩中学,学中乐!...
- Nginx的端口修改问题
- 为什么都建议学java而不是python-都已经掌握了Java,为什么我们还要学Python?
- PHP字符编码绕过漏洞总结
- MySQL Sleep进程
- oa服务器维护问题,OA系统数据面临的安全问题及解决方法
- qq空间个人档html代码,QQ空间如何进行个人档管理?
- 让你越来越值钱的秘密:目标清单
- 网易手游《镇魔曲》怎么打?华为畅享6S帮你春节同学聚会露一手
- mysql——关于找不到vrcuntime140.dll与vrcuntime140_1.dll的问题
- 十分钟搞定阿里云免费https证书申请和配置
- 五款最优秀的java微服务框架
- win10更改账户/用户名称
- Elasticsearch: date时间数据格式踩过的坑
- 小心看上去平平无奇的陷阱:如何防范高级渣?