Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/queirozfcom/python-ds-util
Collection of useful helper methods for interactive data science work in python. Usually on jupyter notebooks, using the basic python scientific stack.
https://github.com/queirozfcom/python-ds-util
data-science matplotlib pandas python scikit-learn utils
Last synced: 26 days ago
JSON representation
Collection of useful helper methods for interactive data science work in python. Usually on jupyter notebooks, using the basic python scientific stack.
- Host: GitHub
- URL: https://github.com/queirozfcom/python-ds-util
- Owner: queirozfcom
- License: mit
- Created: 2018-07-11T01:18:26.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-11-01T02:37:53.000Z (about 3 years ago)
- Last Synced: 2024-09-28T13:22:42.942Z (about 1 month ago)
- Topics: data-science, matplotlib, pandas, python, scikit-learn, utils
- Language: Python
- Homepage:
- Size: 909 KB
- Stars: 4
- Watchers: 2
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# python-ds-util
[![PyPI version](https://badge.fury.io/py/dsutil.png)](https://badge.fury.io/py/dsutil)
## Installation
The library is available on **pip**:
`pip install dsutil`
## Examples
For full usage examples see notebooks under [the examples directory](https://github.com/queirozfcom/python-ds-util/tree/master/examples).
### Plotting
Full examples for plotting [here](https://github.com/queirozfcom/python-ds-util/tree/master/examples/examples-plotting.ipynb)
- `add_grid()`: reasonable default grid settings, with weak grey lines, light alpha, etc.
```python
import numpy as np
import matplotlib.pyplot as plt
from dsutil.plotting import add_grid
x = np.linspace(0.0,100,10)
y = np.random.uniform(low=0,high=10,size=10)plt.bar(x,y)
add_grid()
```
- `add_value_labels()` annotates barplots, line plots and scatter plots with values for the coordinates
```python
import numpy as np
import matplotlib.pyplot as plt
from dsutil.plotting import add_value_labels
x = np.linspace(0.0,100,10)
y = np.random.uniform(low=0,high=10,size=10)plt.bar(x,y)
add_value_labels()
```
- `format_yaxis_percentage()`: turns values between 0 and 1 in y-axis into percentages
```python
import numpy as np
import matplotlib.pyplot as plt
from dsutil.plotting import format_yaxis_percentage
x = np.linspace(0.0,100,10)
y = np.random.uniform(low=0,high=1,size=10)
plt.bar(x,y)
plt.yticks(np.arange(0,1.01,0.1))format_yaxis_percentage()
```
- `format_yaxis_thousands()`: uses commas as thousands separator in the y-axis labels
```python
import numpy as np
import matplotlib.pyplot as plt
from dsutil.plotting import format_yaxis_thousands
x = np.linspace(0.0,100,10)
y = np.random.uniform(low=10000,high=100000,size=10)plt.bar(x,y)
plt.yticks(np.arange(0,100001,10000))format_yaxis_thousands()
```