由apache arrow支持的pandas扩展类型/数组

fletcher的Python项目详细描述


弗莱彻

CircleCICode style: black

提供泛型pandas扩展类型/数组集的库 由apache arrow支持的实现。它们支持更广泛的类型 比大熊猫天生的支持,也带来了不同的约束和 在许多情况下有益的行为。

用法

要在pandas数据帧中使用fletcher,只需包装数据 在FletcherArray对象中。您的数据可以是pyarrow.Arraypyarrow.ChunkedArray或可传递给pyarrow.array(…)的类型。

import fletcher as fr
import pandas as pd

df = pd.DataFrame({
    'str': fr.FletcherArray(['a', 'b', 'c'])
})

df.info()

# RangeIndex: 3 entries, 0 to 2
# Data columns (total 1 columns):
# str    3 non-null fletcher[string]
# dtypes: fletcher[string](1)
# memory usage: 100.0 bytes

开发

虽然可以在基于pip的环境中使用fletcher,但我们强烈建议 对来自conda-forge的包使用基于conda的开发设置。

# Create the conda environment with all necessary dependencies
conda create -y -q -n fletcher python=3.6 \
    black=18.5b0 \
    codecov \
    flake8 \
    numba \
    pandas \
    pip \
    pyarrow \
    pytest \
    pytest-cov \
    pytest-flake8 \
    six \
    -c conda-forge

# Activate the newly created environment
source activate fletcher

# Install fletcher into the current environment
pip install -e .

# Run the unit tests (you should do this several times during development)
py.test

代码格式化使用黑色完成。这应该能让一切 一致的样式和格式可以使用 black .。注意,我们已经锁定了black的版本,以确保 格式是可复制的。

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

推荐PyPI第三方库


热门话题
java线程;创建一个单独的线程来定期执行某些操作   用java将SonarQube升级到5.2失败。util。同时发生的CancellationException:空   在线程对象上调用start时,线程上设置的java优先级无效   java如何在不使用reduce()或last()折叠的情况下获取通量的最后一项   java如何从ArrayList中获取元素?   应用了逻辑的JavaTwitterAPI   在这种情况下,怎样才能不让自己重复?安卓的java   JavaAndroid:线程可运行和处理程序。在run方法中发布问题(Handler.postXX在预期情况下不会按时运行)   java log4j grok与管道故障   使用循环返回命令选项时出现问题/仅运行一个命令(JAVA)   java双重比较问题   使用vertx的JWT公钥/私钥身份验证中的java握手   用Java将WMA和AAC音频转换为MP3   解析字符串java get index   与具有不同数据类型的密钥同名的java JSON