Skip to content
This repository has been archived by the owner on Jan 22, 2020. It is now read-only.

Commit

Permalink
Link to docs in README
Browse files Browse the repository at this point in the history
  • Loading branch information
miroli committed Jan 25, 2019
1 parent 7020653 commit 035a11a
Showing 1 changed file with 1 addition and 53 deletions.
54 changes: 1 addition & 53 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,56 +1,4 @@
Frame2Package
=============

A helper library for converting Pandas dataframes to DDF packages.

## Usage

```python
import pandas as pd
import io
from frame2package import Frame2Package

# Load some sample data

data = """area year age education distribution
Bahamas 2000 15+ Total 1.0
Fiji 1970 80+ Total 1.0
Gabon 2025 20--64 Under 15 0.0
Brunei Darussalam 2045 All Total 1.0
Thailand 1985 15+ Upper Secondary 0.07
"""

df = pd.read_csv(io.StringIO(data), sep='\t')

# Specify all the concepts in the dataset
# as per the DDF data format specification.

concepts = [
{
'concept': 'area',
'concept_type': 'entity_domain'
},
{
'concept': 'year',
'concept_type': 'time'
},
{
'concept': 'age',
'concept_type': 'string'
},
{
'concept': 'education',
'concept_type': 'entity_domain'
},
{
'concept': 'distribution',
'concept_type': 'measure'
},
]

# Initialize a Frame2Package object
f2p = Frame2Package(data=df, concepts=concepts)

# Save the package
f2p.to_package('sample-dataset')
```
A helper library for converting Pandas dataframes to DDF packages: [frame2package.readthedocs.io](https://frame2package.readthedocs.io).

0 comments on commit 035a11a

Please sign in to comment.