Object-oriented pandas DataFrame mapper.
Project description
THIS IS EXPERIMENTAL.
Requirements
Python 3.5+
Pandas 0.20.0+
Installation
Install DataFrame Mapper via pip:
$ pip install dataframe-mapper
Example
Simple DataFrame Mapper example:
from dfmapper import DataFrameMapper, IntColumn, StrColumn class UserDfm(DataFrameMapper): id = IntColumn(min=1, nullable=False) username = StrColumn(max_length=30, nullable=False) profile = StrColumn() def find_by_id(self, id): return self.df[self.df.id == id] user_dfm = UserDfm({ "id": [1, 2, 3], "username": ["Bessie Bennett", "Sandra Matthews", "Jessie Bates"], "profile": ["BLAH BLAH BLAH", "PITH PITH PITH", None] }) user_dfm.validate() #: True user_dfm.find_by_id(1) #: id username profile #: 0 1 Bessie Bennett BLAH BLAH BLAH
License
DataFrame Mapper is licensed under MIT License. See LICENSE for more information.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file dataframe-mapper-0.0.2.tar.gz
.
File metadata
- Download URL: dataframe-mapper-0.0.2.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9eecb0816e21f404ca8a385d1f888a5e9b5bc70793c9aafe7af536ab68634f47 |
|
MD5 | 557778b384fcac9e260625edf45e983c |
|
BLAKE2b-256 | 17c2bd900cc0393680397cadbd0e07d4f005effe74b9dd6c0d2acb64b3415b72 |
File details
Details for the file dataframe_mapper-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: dataframe_mapper-0.0.2-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45ac936a5456ed9557bd3072a94345e15a0f417f124d9234726ac5491e899288 |
|
MD5 | 40e77709e2cc43adbce9d3ec72edf5fe |
|
BLAKE2b-256 | 051267be875cbdbe932e210f1a32f421cf0d59f824b346b73a66063401a10a76 |