数据处理的函数式编程工具

fntools的Python项目详细描述


https://readthedocs.org/projects/fntools/badge/?version=master
target:https://readthedocs.org/projects/fntools/?badge=master
alt:Documentation Status

fntools提供用于数据处理的函数式编程工具。这个 模块是我在工作中需要并发现有用的一组函数。

安装

pip install fntools

示例

  • 使用split拆分元素列表:

    songs = ('Black', 'Even Flow', 'Amongst the waves', 'Sirens')
    albums = ('Ten', 'Ten', 'Backspacer', 'Lightning Bolt')
    print split(songs, albums)
    {'Lightning Bolt': ['Sirens'], 'Ten': ['Black', 'Even Flow'], 'Backspacer': ['Amongst the waves']}
    
  • 确定列表中的任何元素是否包含在另一个列表中,其中any_in

    print any_in(['Oceans', 'Big Wave'], ['Once', 'Alive', 'Oceans', 'Release'])
    True
    
    print any_in(['Better Man'], ['Man of the Hour', 'Thumbing my way'])
    False
    
  • 使用dispatch对数据应用许多函数:

    # Suppose we want to know the mean, the standard deviation and the median of
    # a distribution (here we use the standard normal distribution)
    
    import numpy as np
    np.random.seed(10)
    x = np.random.randn(10000)
    
    print dispatch(x, (np.mean, np.std, np.median))
    [0.0051020560019149385, 0.98966401277169491, 0.013111308495186252]
    

更多有用的功能是可用的。有关详细信息,请转到 documentation

灵感

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
使用freemarker(ftl模板)通过spring发送outlook电子邮件的java自定义表单   java Project Euler 17错误答案   java想澄清所有关于Android多屏幕尺寸支持的疑问吗?   如何使用Eclipse和Maven配置Java项目以连接到AmazonRDS   java如何在Java8中按流对映射对象按时间段求和?   我是Java新手,希望有人能帮我   java Spring boot,序列化和反序列化时Jackson Json问题   java扫雷器(不是算法,只是布局问题)   java找到一个字符[]的完全唯一排列吗?   java哪种CRC用于更改Desfire卡中的密钥   java如何修复越界索引错误?   java读取Excel数值单元格值   java如何正确构建“PUT方法”并执行“intern请求”?   java如何从XSD生成JAXB类?   java为什么要运行它?   Java,畸形异常   java Springsecurityldap:实例化InitialContextFactory com失败。太阳jndi。ldap。LDAPCTX工厂   解析Java无法读取文本文件   java在每个请求之前运行资源方法