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.2.0.tar.gz (93.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aiida_dataframe-0.2.0-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file aiida_dataframe-0.2.0.tar.gz.

File metadata

  • Download URL: aiida_dataframe-0.2.0.tar.gz
  • Upload date:
  • Size: 93.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.4

File hashes

Hashes for aiida_dataframe-0.2.0.tar.gz
Algorithm Hash digest
SHA256 99b88c23f778c5f568e6cda5bb4ea95f971da7f7f39b80809952eaa6a4143fd6
MD5 813a1bf7e335df22d32561698aa5e313
BLAKE2b-256 ee1ba01387f75fccf8ddab0ee549930f13ad0e8d6053c3358a99108db89f0225

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for aiida_dataframe-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c81873f1628189804f33129dfbb4386943440cdf4f49c5b0aa8184bd28f774c3
MD5 4e2751e293665a76525e0726c99175ef
BLAKE2b-256 3631d4ebe6ec396ae1ddd856ad8a4f4b96822111ff974ed968422b919ac7a147

See more details on using hashes here.

Supported by

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