%global _empty_manifest_terminate_build 0
Name: python-chart
Version: 0.2.3
Release: 1
Summary: chart
License: MIT
URL: https://github.com/maxhumber/chart
Source0: https://mirrors.nju.edu.cn/pypi/web/packages/b3/e0/b10edf6b4ed5d4bc26b8d9b63d769b85efac89f186a733c73147561f1dd3/chart-0.2.3.tar.gz
BuildArch: noarch
%description
A zero-dependency python package that prints basic charts to a Jupyter output
Charts supported:
- Bar graphs
- Scatter plots
- Histograms
- 🍑📊👏
#### Examples
Bar graphs can be drawn quickly with the `bar` function:
```python
from chart import bar
x = [500, 200, 900, 400]
y = ['marc', 'mummify', 'chart', 'sausagelink']
bar(x, y)
```
```
marc: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇
mummify: ▇▇▇▇▇▇▇
chart: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇
sausagelink: ▇▇▇▇▇▇▇▇▇▇▇▇▇
```
And the `bar` function can accept columns from a `pd.DataFrame`:
```python
from chart import bar
import pandas as pd
df = pd.DataFrame({
'artist': ['Tame Impala', 'Childish Gambino', 'The Knocks'],
'listens': [8_456_831, 18_185_245, 2_556_448]
})
bar(df.listens, df.artist, width=20, label_width=11, mark='🔊')
```
```
Tame Impala: 🔊🔊🔊🔊🔊🔊🔊🔊🔊
Childish Ga: 🔊🔊🔊🔊🔊🔊🔊🔊🔊🔊🔊🔊🔊🔊🔊🔊🔊🔊🔊🔊
The Knocks: 🔊🔊🔊
```
Histograms are just as easy:
```python
from chart import histogram
x = [1, 2, 4, 3, 3, 1, 7, 9, 9, 1, 3, 2, 1, 2]
histogram(x)
```
```
▇
▇
▇
▇
▇ ▇
▇ ▇
▇ ▇
▇ ▇ ▇
▇ ▇ ▇
▇ ▇ ▇ ▇
```
And they can accept objects created by `scipy`:
```python
from chart import histogram
import scipy.stats as stats
import numpy as np
np.random.seed(14)
n = stats.norm(loc=0, scale=10)
histogram(n.rvs(100), bins=14, height=7, mark='🍑')
```
```
🍑
🍑 🍑
🍑 🍑 🍑
🍑 🍑 🍑
🍑 🍑 🍑 🍑
🍑 🍑 🍑 🍑 🍑 🍑 🍑 🍑 🍑
🍑 🍑 🍑 🍑 🍑 🍑 🍑 🍑 🍑 🍑
```
Scatter plots can be drawn with a simple `scatter` call:
```python
from chart import scatter
x = range(0, 20)
y = range(0, 20)
scatter(x, y)
```
```python
•
• •
•
• •
• •
•
• •
•
• •
• •
•
• •
•
```
And at this point you gotta know it works with any `np.array`:
```python
from chart import scatter
import numpy as np
np.random.seed(1)
N = 100
x = np.random.normal(100, 50, size=N)
y = x * -2 + 25 + np.random.normal(0, 25, size=N)
scatter(x, y, width=20, height=9, mark='^')
```
```
^^
^
^^^
^^^^^^^
^^^^^^
^^^^^^^
^^^^
^^^^^ ^
^^ ^
```
In fact, all `chart` functions work with pandas, numpy, scipy and regular python objects.
#### Preprocessors
In order to create the simple outputs generated by `bar`, `histogram`, and `scatter` I had to create a couple of preprocessors, namely: `NumberBinarizer` and `RangeScaler`.
I tried to adhere to the scikit-learn API in their construction. Although you won't need them to use `chart` here they are for your tinkering:
```python
from chart.preprocessing import NumberBinarizer
nb = NumberBinarizer(bins=4)
x = range(10)
nb.fit(x)
nb.transform(x)
```
```
[0, 0, 0, 1, 1, 2, 2, 3, 3, 3]
```
```python
from chart.preprocessing import RangeScaler
rs = RangeScaler(out_range=(0, 10), round=False)
x = range(50, 59)
rs.fit_transform(x)
```
```
[0.0, 1.25, 2.5, 3.75, 5.0, 6.25, 7.5, 8.75, 10.0]
```
#### Installation
```python
pip install chart
```
#### Contribute
For feature requests or bug reports, please use [Github Issues](https://github.com/maxhumber/chart/issues)
#### Inspiration
I wanted a super-light-weight library that would allow me to quickly grok data. Matplotlib had too many dependencies, and Altair seemed overkill. Though I really like the idea of [termgraph](https://github.com/mkaz/termgraph), it didn't really fit well or integrate with my Jupyter workflow. Here's to `chart` 🥂 (still can't believe I got it on [PyPI](https://pypi.org/project/chart/))
%package -n python3-chart
Summary: chart
Provides: python-chart
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pip
%description -n python3-chart
A zero-dependency python package that prints basic charts to a Jupyter output
Charts supported:
- Bar graphs
- Scatter plots
- Histograms
- 🍑📊👏
#### Examples
Bar graphs can be drawn quickly with the `bar` function:
```python
from chart import bar
x = [500, 200, 900, 400]
y = ['marc', 'mummify', 'chart', 'sausagelink']
bar(x, y)
```
```
marc: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇
mummify: ▇▇▇▇▇▇▇
chart: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇
sausagelink: ▇▇▇▇▇▇▇▇▇▇▇▇▇
```
And the `bar` function can accept columns from a `pd.DataFrame`:
```python
from chart import bar
import pandas as pd
df = pd.DataFrame({
'artist': ['Tame Impala', 'Childish Gambino', 'The Knocks'],
'listens': [8_456_831, 18_185_245, 2_556_448]
})
bar(df.listens, df.artist, width=20, label_width=11, mark='🔊')
```
```
Tame Impala: 🔊🔊🔊🔊🔊🔊🔊🔊🔊
Childish Ga: 🔊🔊🔊🔊🔊🔊🔊🔊🔊🔊🔊🔊🔊🔊🔊🔊🔊🔊🔊🔊
The Knocks: 🔊🔊🔊
```
Histograms are just as easy:
```python
from chart import histogram
x = [1, 2, 4, 3, 3, 1, 7, 9, 9, 1, 3, 2, 1, 2]
histogram(x)
```
```
▇
▇
▇
▇
▇ ▇
▇ ▇
▇ ▇
▇ ▇ ▇
▇ ▇ ▇
▇ ▇ ▇ ▇
```
And they can accept objects created by `scipy`:
```python
from chart import histogram
import scipy.stats as stats
import numpy as np
np.random.seed(14)
n = stats.norm(loc=0, scale=10)
histogram(n.rvs(100), bins=14, height=7, mark='🍑')
```
```
🍑
🍑 🍑
🍑 🍑 🍑
🍑 🍑 🍑
🍑 🍑 🍑 🍑
🍑 🍑 🍑 🍑 🍑 🍑 🍑 🍑 🍑
🍑 🍑 🍑 🍑 🍑 🍑 🍑 🍑 🍑 🍑
```
Scatter plots can be drawn with a simple `scatter` call:
```python
from chart import scatter
x = range(0, 20)
y = range(0, 20)
scatter(x, y)
```
```python
•
• •
•
• •
• •
•
• •
•
• •
• •
•
• •
•
```
And at this point you gotta know it works with any `np.array`:
```python
from chart import scatter
import numpy as np
np.random.seed(1)
N = 100
x = np.random.normal(100, 50, size=N)
y = x * -2 + 25 + np.random.normal(0, 25, size=N)
scatter(x, y, width=20, height=9, mark='^')
```
```
^^
^
^^^
^^^^^^^
^^^^^^
^^^^^^^
^^^^
^^^^^ ^
^^ ^
```
In fact, all `chart` functions work with pandas, numpy, scipy and regular python objects.
#### Preprocessors
In order to create the simple outputs generated by `bar`, `histogram`, and `scatter` I had to create a couple of preprocessors, namely: `NumberBinarizer` and `RangeScaler`.
I tried to adhere to the scikit-learn API in their construction. Although you won't need them to use `chart` here they are for your tinkering:
```python
from chart.preprocessing import NumberBinarizer
nb = NumberBinarizer(bins=4)
x = range(10)
nb.fit(x)
nb.transform(x)
```
```
[0, 0, 0, 1, 1, 2, 2, 3, 3, 3]
```
```python
from chart.preprocessing import RangeScaler
rs = RangeScaler(out_range=(0, 10), round=False)
x = range(50, 59)
rs.fit_transform(x)
```
```
[0.0, 1.25, 2.5, 3.75, 5.0, 6.25, 7.5, 8.75, 10.0]
```
#### Installation
```python
pip install chart
```
#### Contribute
For feature requests or bug reports, please use [Github Issues](https://github.com/maxhumber/chart/issues)
#### Inspiration
I wanted a super-light-weight library that would allow me to quickly grok data. Matplotlib had too many dependencies, and Altair seemed overkill. Though I really like the idea of [termgraph](https://github.com/mkaz/termgraph), it didn't really fit well or integrate with my Jupyter workflow. Here's to `chart` 🥂 (still can't believe I got it on [PyPI](https://pypi.org/project/chart/))
%package help
Summary: Development documents and examples for chart
Provides: python3-chart-doc
%description help
A zero-dependency python package that prints basic charts to a Jupyter output
Charts supported:
- Bar graphs
- Scatter plots
- Histograms
- 🍑📊👏
#### Examples
Bar graphs can be drawn quickly with the `bar` function:
```python
from chart import bar
x = [500, 200, 900, 400]
y = ['marc', 'mummify', 'chart', 'sausagelink']
bar(x, y)
```
```
marc: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇
mummify: ▇▇▇▇▇▇▇
chart: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇
sausagelink: ▇▇▇▇▇▇▇▇▇▇▇▇▇
```
And the `bar` function can accept columns from a `pd.DataFrame`:
```python
from chart import bar
import pandas as pd
df = pd.DataFrame({
'artist': ['Tame Impala', 'Childish Gambino', 'The Knocks'],
'listens': [8_456_831, 18_185_245, 2_556_448]
})
bar(df.listens, df.artist, width=20, label_width=11, mark='🔊')
```
```
Tame Impala: 🔊🔊🔊🔊🔊🔊🔊🔊🔊
Childish Ga: 🔊🔊🔊🔊🔊🔊🔊🔊🔊🔊🔊🔊🔊🔊🔊🔊🔊🔊🔊🔊
The Knocks: 🔊🔊🔊
```
Histograms are just as easy:
```python
from chart import histogram
x = [1, 2, 4, 3, 3, 1, 7, 9, 9, 1, 3, 2, 1, 2]
histogram(x)
```
```
▇
▇
▇
▇
▇ ▇
▇ ▇
▇ ▇
▇ ▇ ▇
▇ ▇ ▇
▇ ▇ ▇ ▇
```
And they can accept objects created by `scipy`:
```python
from chart import histogram
import scipy.stats as stats
import numpy as np
np.random.seed(14)
n = stats.norm(loc=0, scale=10)
histogram(n.rvs(100), bins=14, height=7, mark='🍑')
```
```
🍑
🍑 🍑
🍑 🍑 🍑
🍑 🍑 🍑
🍑 🍑 🍑 🍑
🍑 🍑 🍑 🍑 🍑 🍑 🍑 🍑 🍑
🍑 🍑 🍑 🍑 🍑 🍑 🍑 🍑 🍑 🍑
```
Scatter plots can be drawn with a simple `scatter` call:
```python
from chart import scatter
x = range(0, 20)
y = range(0, 20)
scatter(x, y)
```
```python
•
• •
•
• •
• •
•
• •
•
• •
• •
•
• •
•
```
And at this point you gotta know it works with any `np.array`:
```python
from chart import scatter
import numpy as np
np.random.seed(1)
N = 100
x = np.random.normal(100, 50, size=N)
y = x * -2 + 25 + np.random.normal(0, 25, size=N)
scatter(x, y, width=20, height=9, mark='^')
```
```
^^
^
^^^
^^^^^^^
^^^^^^
^^^^^^^
^^^^
^^^^^ ^
^^ ^
```
In fact, all `chart` functions work with pandas, numpy, scipy and regular python objects.
#### Preprocessors
In order to create the simple outputs generated by `bar`, `histogram`, and `scatter` I had to create a couple of preprocessors, namely: `NumberBinarizer` and `RangeScaler`.
I tried to adhere to the scikit-learn API in their construction. Although you won't need them to use `chart` here they are for your tinkering:
```python
from chart.preprocessing import NumberBinarizer
nb = NumberBinarizer(bins=4)
x = range(10)
nb.fit(x)
nb.transform(x)
```
```
[0, 0, 0, 1, 1, 2, 2, 3, 3, 3]
```
```python
from chart.preprocessing import RangeScaler
rs = RangeScaler(out_range=(0, 10), round=False)
x = range(50, 59)
rs.fit_transform(x)
```
```
[0.0, 1.25, 2.5, 3.75, 5.0, 6.25, 7.5, 8.75, 10.0]
```
#### Installation
```python
pip install chart
```
#### Contribute
For feature requests or bug reports, please use [Github Issues](https://github.com/maxhumber/chart/issues)
#### Inspiration
I wanted a super-light-weight library that would allow me to quickly grok data. Matplotlib had too many dependencies, and Altair seemed overkill. Though I really like the idea of [termgraph](https://github.com/mkaz/termgraph), it didn't really fit well or integrate with my Jupyter workflow. Here's to `chart` 🥂 (still can't believe I got it on [PyPI](https://pypi.org/project/chart/))
%prep
%autosetup -n chart-0.2.3
%build
%py3_build
%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .
%files -n python3-chart -f filelist.lst
%dir %{python3_sitelib}/*
%files help -f doclist.lst
%{_docdir}/*
%changelog
* Fri May 05 2023 Python_Bot - 0.2.3-1
- Package Spec generated