Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feedback andres #60

Merged
merged 3 commits into from
Mar 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 80 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,83 @@ The official documentation is currently in development and not available now. We

<https://pysketball.readthedocs.io/en/latest/>

### Dependencies

Before installing the package make sure your working environment complies with the following dependecies:

- Python 3.7

- Pandas 1.0.1 or higher. To install the lastest release of the package via conda-forge channels use:

```sh
conda install pandas
```
or via PyPI:

```sh
pip install --upgrade pandas
```

- Pytest 5.3.5 or higher. To install the lastest release of the package via conda-forge channels use:

```sh
conda install pytest
```

or via PyPI:

```sh
pip install --upgrade pytest
```

- Numpy 1.18.1 or higher. To install the lastest release of the package via conda-forge channels use:

```sh
conda install numpy
```

or via PyPI:

```sh
pip install --upgrade numpy
```

- Altair 4.0.1. To install this specific realese via conda-forge channels use:

```sh
conda install altair=4.0.1
```

or via PyPI:

```sh
pip install --upgrade altair==4.0.1
```

- Selenium 5.3.5 or higher. To install the lastest realese of this package via conda-forge channels use:

```sh
conda install selenium
```

- Request 2.23.0 or higher. To install the lastest realese of this package via conda-forge channels use:

```sh
conda install requests
```

or via PyPI:

```sh
pip install --upgrade requests
```

- Python-semantic-release 4.10.0 or higher. To install the lastest realese of this package via PyPI use:

```sh
pip install --upgrade python-semantic-release
```

### Usage and Testing Instructions/Requirements

The `pysketball` package uses the Selenium tool as part of its `nba_scraper` function. Thus, it is necessary to install a webdriver for Selenium's automated driver web browsing.
Expand Down Expand Up @@ -73,7 +150,7 @@ whereis chromedriver
With that, add it to your PATH in your `.bashrc` file for Linux and Mac users.

```sh
export PATH="<PATH_TO_CHROMEDRIVER.EXE>:$PATH"
export PATH="<PATH_TO_CHROMEDRIVER>:$PATH"
```

For Windows, please refer to this [article guide for instructions on adding PATH variables](https://helpdeskgeek.com/windows-10/add-windows-path-environment-variable/).
Expand Down Expand Up @@ -118,8 +195,8 @@ With the scraped data in the form of a `pandas.DataFrame` called `nba_2018_regul
>>> from pysketball.nba_ranking import nba_ranking
>>> from pysketball.nba_team_stats import nba_team_stats
>>> # Scrape regular season 2018/19 and return a dataframe while storing it as csv file called "nba_2018_regular.csv"
>>> nba_boxplot(nba_2018_regular, position= "POS", teams= None, stats= "GP")
>>> nba_ranking(nba_2018_regular, 'PLAYER' , 'GP', top = 2, ascending = False, fun = 'mean')
>>> nba_boxplot(nba_2018_regular, position= 'POS', teams= None, stats= 'GP')
>>> nba_ranking(nba_2018_regular, 'NAME' , 'GP', top = 2, ascending = False, fun = 'mean')
>>> nba_team_stats.nba_team_stats(nba_2018_regular, stats_filter = ['GP', '3PM', 'FT%'],teams_filter = ['UTAH', 'PHX', 'DET'],positions_filter = ['C', 'PG'])
```

Expand Down
2 changes: 1 addition & 1 deletion pysketball/nba_ranking.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def nba_ranking(data, column, by, top=10, ascending=True, fun='mean'):

# The descending argument should be a boolean
if (fun not in ['sum', 'mean']):
raise TypeError("The fun argument should be either var or mean")
raise TypeError("The fun argument should be either sum or mean")

# Checks if the column exists in the dataframe
if column not in data.columns:
Expand Down