pandas.map
来源:互联网 发布:淘宝卖家信誉怎么算 编辑:程序博客网 时间:2024/06/06 03:06
Series.
map
(arg, na_action=None)[source]¶Map values of Series using input correspondence (which can bea dict, Series, or function)
Parameters: arg : function, dict, or Series
na_action : {None, ‘ignore’}
If ‘ignore’, propagate NA values, without passing them to themapping function
Returns: y : Series
same index as caller
Examples
Map inputs to outputs
>>> xone 1two 2three 3
>>> y1 foo2 bar3 baz
>>> x.map(y)one footwo barthree baz
Use na_action to control whether NA values are affected by the mappingfunction.
>>> s = pd.Series([1, 2, 3, np.nan])
>>> s2 = s.map(lambda x: 'this is a string {}'.format(x), na_action=None)0 this is a string 1.01 this is a string 2.02 this is a string 3.03 this is a string nandtype: object
>>> s3 = s.map(lambda x: 'this is a string {}'.format(x), na_action='ignore')0 this is a string 1.01 this is a string 2.02 this is a string 3.03 NaNdtype: object
http://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.map.html
0 0
- pandas.map
- pandas map()用法
- pandas 中Series的map函数
- pandas的apply和map、applymap
- pandas 中Series的map函数
- pandas
- pandas
- Pandas
- pandas
- pandas
- pandas
- pandas
- Pandas
- pandas
- pandas
- pandas
- pandas
- pandas
- Git简易教程(一)
- c/c++实现字符串模式匹配BM算法和KMP算法
- python Pexpect
- socket的创建(六)
- Leetcode
- pandas.map
- 5-6 堆中的路径 (25分)
- 题目1014:排名(核心字符串比较strcmp())
- 几种判断点与多边形关系的算法介绍
- Telnet Port 原理
- qt安装时“Error during installation process(qt.tools.perl):Execution failed”的解决办法
- java编程思想读书笔记-第十一章 java I/O系统
- L
- 绑定和分配mmap内核空间(bind_ring)--(七)