Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/ngrion/apode
Browse files Browse the repository at this point in the history
  • Loading branch information
ngrion committed Dec 9, 2020
2 parents 46758ad + f8aed26 commit 54c30dc
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 17 deletions.
53 changes: 39 additions & 14 deletions README.md
Expand Up @@ -13,38 +13,63 @@
Apode is a package that contains a set of indicators that are applied in economic analysis. It contains measures of poverty, inequality, polarization, welfare and concentration.




## Requirements
You need Python 3.8 to run Apode.

## Code Repository & Issues

https://github.com/ngrion/apode

## Basic Install

Execute

## Installation
Clone this repo and then inside the local directory execute
```console
$ pip install apode
```

$ pip install -e .
## Development Install


Clone this repo and install with pip

```console
$ git clone https://github.com/ngrion/apode.git
$ cd pycf3
$ pip install -e .
```


## Features

Objects are created using:

ad = ApodeData(DataFrame, income_column)
```python
>>> ad = ApodeData(DataFrame, income_column)
```

Where income_column is the name of the desired analysis column in the dataframe.

Methods that calculate indicators:

ad.poverty(method,*args)
ad.ineq(method,*args)
ad.welfare(method,*args)
ad.polarization(method,*args)
ad.concentration(method,*args)

```python
>>> ad.poverty(method,*args)
>>> ad.ineq(method,*args)
>>> ad.welfare(method,*args)
>>> ad.polarization(method,*args)
>>> ad.concentration(method,*args)
```

Graphical representations:

ad.plot.hist()
ad.plot.tip(**kwargs)
ad.plot.lorenz(**kwargs)
ad.plot.pen(**kwargs)
```python
>>> ad.plot.hist()
>>> ad.plot.tip(**kwargs)
>>> ad.plot.lorenz(**kwargs)
>>> ad.plot.pen(**kwargs)
```

For examples on how to use apode, please refer to the [Tutorial](https://apode.readthedocs.io/en/latest/Tutorial.html).

Expand Down
4 changes: 2 additions & 2 deletions apode/basic.py
Expand Up @@ -23,7 +23,7 @@

from .concentration import ConcentrationMeasures
from .inequality import InequalityMeasures
from .plots import PlotAccsessor
from .plots import PlotAccessor
from .polarization import PolarizationMeasures
from .poverty import PovertyMeasures
from .welfare import WelfareMeasures
Expand Down Expand Up @@ -79,7 +79,7 @@ class ApodeData:
init=False, default=attr.Factory(WelfareMeasures, takes_self=True)
)
plot = attr.ib(
init=False, default=attr.Factory(PlotAccsessor, takes_self=True)
init=False, default=attr.Factory(PlotAccessor, takes_self=True)
)

@income_column.validator
Expand Down
2 changes: 1 addition & 1 deletion apode/plots.py
Expand Up @@ -38,7 +38,7 @@


@attr.s(frozen=True)
class PlotAccsessor:
class PlotAccessor:
"""Plots for Apode.
The following plots are implemented:
Expand Down

0 comments on commit 54c30dc

Please sign in to comment.