Code Monkey home page Code Monkey logo

xndframes's Introduction

xndframes

CircleCI Build Status Documentation Status codecov

Xndframes is a Python package that provides a set of Pandas ExtensionDType/Array implementations backed by xnd. Xnd implements a container type that maps most Python values relevant for scientific computing directly to typed memory.

Xndframes provides support for storing xnd containers data inside a pandas Series and/or Dataframe using pandas' Extension Array Interface.

In [1]: import xndframes as xf

In [2]: import pandas as pd

In [3]: s = ["Hello", "World", None]

In [4]: sa = xf.XndframesArray(s)

In [5]: sa.data
Out[5]: xnd(['Hello', 'World', None], type='3 * ?string')

In [6]: sa
Out[6]: <xndframes.base.XndframesArray at 0x7f836bb349b0>

In [7]: ser = pd.Series(sa)

In [8]: ser
Out[8]:
0    Hello
1    World
2     None
dtype: xndframes[3 * ?string]

In [9]: df = pd.DataFrame({'strings': sa})

In [10]: df
Out[10]:
  strings
0   Hello
1   World
2    None

In [11]: df.info()
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 3 entries, 0 to 2
Data columns (total 1 columns):
strings    2 non-null xndframes[3 * ?string]
dtypes: xndframes[3 * ?string](1)
memory usage: 104.0 bytes

In [12]: df.isna()
Out[12]:
   strings
0    False
1    False
2     True

See the documentation for more.

Try xndframes in the cloud

To try out xndframes interactively in your web browser, just click on the binder link:

Binder

Contributing

Contributions are welcome! For bug reports or requests please submit an issue.

xndframes's People

Contributors

andersy005 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.