Skip to main content

AiiDA data plugin for pandas DataFrame objects

Project description

Build Status Coverage Status Docs status PyPI version

aiida-dataframe

AiiDA data plugin for pandas DataFrame objects

Features

  • Store pandas.DataFrame objects in the Database:

    import pandas as pd
    PandasFrameData = DataFactory('dataframe.frame')
    df = pd.DataFrame(
         {
             "A": 1.0,
             "B": pd.Timestamp("20130102"),
             "C": pd.Series(1, index=list(range(4)), dtype="float32"),
             "D": np.array([3] * 4, dtype="int32"),
             "E": pd.Categorical(["test", "train", "test", "train"]),
             "F": "foo",
         }
     )
    df_node = PandasFrameData(df)
    df_node.store()
    
  • Retrieving the pandas.DataFrame from the Database :

    from aiida.orm import QueryBuilder
    df_node = QueryBuilder().append(PandasFrameData).first()[0]
    df = df_node.df #The df property reconstructs the pandas DataFrame
    print(df.head())
    

Installation

pip install aiida-dataframe
verdi quicksetup  # better to set up a new profile
verdi plugin list aiida.data  # should now show your data plugins

Usage

The plugin also includes verdi commands to inspect its data types:

verdi data dataframe list
verdi data dataframe export <PK>
verdi data dataframe show <PK>

Development

git clone https://github.com/janssenhenning/aiida-dataframe .
cd aiida-dataframe
pip install --upgrade pip
pip install -e .[pre-commit,testing]  # install extra dependencies
pre-commit install  # install pre-commit hooks
pytest -v  # discover and run all tests

See the developer guide for more information.

License

MIT

Contact

henning.janssen@gmx.net

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aiida-dataframe-0.1.3.tar.gz (91.8 kB view details)

Uploaded Source

Built Distribution

aiida_dataframe-0.1.3-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file aiida-dataframe-0.1.3.tar.gz.

File metadata

  • Download URL: aiida-dataframe-0.1.3.tar.gz
  • Upload date:
  • Size: 91.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.30.0

File hashes

Hashes for aiida-dataframe-0.1.3.tar.gz
Algorithm Hash digest
SHA256 a0f08db2e9fdd4283ec9c5a89e10d3e86ed0fa1464844ed43dfaaa6cff56db65
MD5 817c2a2e6ccf916df23e115461f7a477
BLAKE2b-256 af97a05fa4ee5964b79543ad8865bbc24286c9e1b32ce0498671eda98d7f3b83

See more details on using hashes here.

File details

Details for the file aiida_dataframe-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for aiida_dataframe-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5a9c2354af5251e31413d51e7383f3ad23718e2878be13084d9f20017e781b36
MD5 501b56331cbc6b39aab67a7ceaba7da9
BLAKE2b-256 a5668ee142f04536d66b8220cd937febf50175aa880bb3880ff3d62e3a24b0ab

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page