Validate the pandas objects such as DataFrame and Series.
Project description
Validates the pandas object such as DataFrame and Series. And this can define validator like django form class.
import pandas as pd
import pandas_validator as pv
class SampleDataFrameValidator(pv.DataFrameValidator):
row_num = 5
column_num = 2
label1 = pv.IntegerColumnValidator('label1', min_value=0, max_value=10)
label2 = pv.FloatColumnValidator('label2', min_value=0, max_value=10)
validator = SampleDataFrameValidator()
df = pd.DataFrame({'label1': [0, 1, 2, 3, 4], 'label2': [5.0, 6.0, 7.0, 8.0, 9.0]})
validator.is_valid(df) # True.
df = pd.DataFrame({'label1': [11, 12, 13, 14, 15], 'label2': [5.0, 6.0, 7.0, 8.0, 9.0]})
validator.is_valid(df) # False.
df = pd.DataFrame({'label1': [0, 1, 2], 'label2': [5.0, 6.0, 7.0]})
validator.is_valid(df) # False
Getting Started
Installation
$ pip install pandas_validator
Usage
Please see the following demo written by ipython notebook.
Documentation
The latest documentation is hosted at ReadTheDocs.
Requirements
Traget Python version is 2.7, 3.3, 3.4, 3.5
pandas
License
This software is licensed under the MIT License.
Resources
CHANGES
0.3.1 (2015-10-28)
Update support python version
Update dependencies library version
0.3.0 (2015-07-15)
Critical bug fix
0.2.0 (2015-05-24)
Support char type validation
flake8 testing
0.1.0 (2015-05-22)
Initial release.
Support integer series validator
Support float series validator
Support dataframe validator
Testing on python2.7 and python 3.4
0.0.0 (2015-05-17)
Create this project.
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
Built Distribution
Hashes for pandas_validator-0.3.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ad5fa78ac1746961fcef1597267532fc0960ff09b88e9a416a5c15601c1915d |
|
MD5 | 2eac1e351a26e2272fbbe28d04cffd12 |
|
BLAKE2b-256 | fac83e5784f48af6e5c154db9cf768bb4ea9a54bb56afe50eb82f0d1c9747b33 |