由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 Maven无法识别安装在Ubuntu外壳上的$java_HOME jdk   java如何防止可运行程序在其中一个抛出异常时执行   java Listview在按下项时不触发   如何在WindowsPhone8中使用JavaRESTWebService?   java在spring引导下使用多个dispatcher servlet/web上下文   java为什么在删除容器的绝对大小时不绘制GEF子项?   java在hibernate实体中保留DB约束是好的   JavaSpring选择最高优先级bean   ArrayList<Class>java字符串[]   有向加权边图的Java邻接表实现   字母数字字符串的java Tesseract配置:混合2、Z、6和G   如果输入为空,则带有EditText的java警报对话框将关闭   jsp上的java Struts 2动作响应   java获取IndexOutOfBundException Android   scala AWSJAVASDK:解压缩大小必须小于262144000字节