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

hacktober #1

Open
wants to merge 40 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
f190bd6
Fixes #72
ResidentMario Jul 16, 2018
773afba
Update README.md
ResidentMario Nov 24, 2018
ae5519b
Update README.md
ResidentMario Dec 16, 2018
5f38cbc
Provide a colorbar on the heatmap by default.
ResidentMario Feb 16, 2019
078e6b8
Minor linting
ResidentMario Feb 16, 2019
1d67f91
Make fontsize functional.
ResidentMario Feb 16, 2019
cbcc8d5
Implement columnar sorting in bar and heatap. (#87)
ResidentMario Jul 8, 2019
3008db8
Add axis param, return axis objects, and deprecate inline (#88)
ResidentMario Jul 8, 2019
6391dc4
Tweak bar subplot sizing behavior. (#89)
ResidentMario Jul 8, 2019
5b99ad5
Deprecate the geoplot function. (#90)
ResidentMario Jul 9, 2019
2d4b202
Remove deprecated function from README. (#91)
ResidentMario Jul 9, 2019
48d2f06
Pull f-strings from code to maintain py3.4 compatibility. (#92)
ResidentMario Jul 9, 2019
1c69ec9
Bump version.
ResidentMario Jul 9, 2019
a1e1120
Update badges.
ResidentMario Oct 7, 2019
024a0e2
Include additional files in sdists (#97)
toddrme2178 Nov 19, 2019
d575515
Add license to setup.py (#98)
sergiuser1 Feb 10, 2020
d523c82
fixed error 116. (#117)
armando-fandango Jul 26, 2020
40bb099
Stop pointing to old version of python since package supports 3.4+ (#…
edison12a Sep 19, 2020
1d8c590
Update Readme.md to Correct a typo in Heat Map (#121)
chacreton190 Sep 26, 2020
a0de212
feature: simple memory optimization with a numpy parameter (#124)
johnnessantos Nov 23, 2020
df0ca58
docs: fix simple typo, seperate -> separate (#125)
timgates42 Dec 28, 2020
8c31763
Correct return type when inline=False (#132)
maxmahlke Apr 27, 2021
6ad031d
Introduce orientation to bar plot (#94)
sbrugman Jul 3, 2021
5e5607c
Lint, remove deprecated features (#137)
ResidentMario Jul 3, 2021
19dc216
Remove binder. (#138)
ResidentMario Jul 3, 2021
86b52fd
Update README. (#139)
ResidentMario Jul 3, 2021
095f45f
Remove geoplot from tests. (#140)
ResidentMario Jul 3, 2021
4fec860
Download example data from GitHub (#141)
ResidentMario Jul 3, 2021
68b1b9a
Update setup.py
ResidentMario Jul 3, 2021
1f45112
Hotfix: remove import of deleted method (#143)
ResidentMario Jul 4, 2021
79feb2f
Bump the major version number.
ResidentMario Jul 4, 2021
1ea4611
Include calculations in README (#151)
ResidentMario Feb 20, 2022
a0bb989
Remove inline arg from plotters (#152)
ResidentMario Feb 20, 2022
df9ee90
Add label_rotation parameter (#153)
ResidentMario Feb 20, 2022
59bc761
Update README.md
ResidentMario Feb 27, 2022
08a4659
Bump version.
ResidentMario Feb 27, 2022
f35bd89
Update README.md
ResidentMario Feb 27, 2022
99f7954
Matplotlib deprecation warning (#162)
r-leyshon Feb 26, 2023
ead5a06
Chore: remove requirements.txt from previous commit.
ResidentMario Feb 26, 2023
570fa08
Bump version.
ResidentMario Feb 26, 2023
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
Prev Previous commit
Next Next commit
Remove inline arg from plotters (ResidentMario#152)
  • Loading branch information
ResidentMario committed Feb 20, 2022
commit a0bb989ce22191760da7af1352929230abf96b4a
45 changes: 20 additions & 25 deletions missingno/missingno.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@
import warnings


def matrix(df,
filter=None, n=0, p=0, sort=None,
figsize=(25, 10), width_ratios=(15, 1), color=(0.25, 0.25, 0.25),
fontsize=16, labels=None, sparkline=True, inline=False,
freq=None, ax=None):
def matrix(
df, filter=None, n=0, p=0, sort=None, figsize=(25, 10), width_ratios=(15, 1),
color=(0.25, 0.25, 0.25), fontsize=16, labels=None, sparkline=True, freq=None, ax=None
):
"""
A matrix visualization of the nullity of the given DataFrame.

Expand All @@ -30,7 +29,7 @@ def matrix(df,
:param width_ratios: The ratio of the width of the matrix to the width of the sparkline. Defaults to `(15, 1)`.
Does nothing if `sparkline=False`.
:param color: The color of the filled columns. Default is `(0.25, 0.25, 0.25)`.
:return: If `inline` is False, the underlying `matplotlib.figure` object. Else, nothing.
:return: The plot axis.
"""
df = nullity_filter(df, filter=filter, n=n, p=p)
df = nullity_sort(df, sort=sort, axis='columns')
Expand Down Expand Up @@ -196,8 +195,10 @@ def matrix(df,
return ax0


def bar(df, figsize=None, fontsize=16, labels=None, log=False, color='dimgray', inline=False,
filter=None, n=0, p=0, sort=None, ax=None, orientation=None):
def bar(
df, figsize=None, fontsize=16, labels=None, log=False, color='dimgray', filter=None, n=0, p=0,
sort=None, ax=None, orientation=None
):
"""
A bar chart visualization of the nullity of the given DataFrame.

Expand All @@ -214,7 +215,7 @@ def bar(df, figsize=None, fontsize=16, labels=None, log=False, color='dimgray',
:param color: The color of the filled columns. Default to the RGB multiple `(0.25, 0.25, 0.25)`.
:param orientation: The way the bar plot is oriented. Defaults to vertical if there are less than or equal to 50
columns and horizontal if there are more.
:return: If `inline` is False, the underlying `matplotlib.figure` object. Else, nothing.
:return: The plot axis.
"""
df = nullity_filter(df, filter=filter, n=n, p=p)
df = nullity_sort(df, sort=sort, axis='rows')
Expand Down Expand Up @@ -324,11 +325,10 @@ def bar(df, figsize=None, fontsize=16, labels=None, log=False, color='dimgray',
return ax1


def heatmap(df, inline=False,
filter=None, n=0, p=0, sort=None,
figsize=(20, 12), fontsize=16, labels=True,
cmap='RdBu', vmin=-1, vmax=1, cbar=True, ax=None
):
def heatmap(
df, filter=None, n=0, p=0, sort=None, figsize=(20, 12), fontsize=16, labels=True, cmap='RdBu',
vmin=-1, vmax=1, cbar=True, ax=None
):
"""
Presents a `seaborn` heatmap visualization of nullity correlation in the given DataFrame.

Expand All @@ -348,9 +348,7 @@ def heatmap(df, inline=False,
:param cmap: What `matplotlib` colormap to use. Defaults to `RdBu`.
:param vmin: The normalized colormap threshold. Defaults to -1, e.g. the bottom of the color scale.
:param vmax: The normalized colormap threshold. Defaults to 1, e.g. the bottom of the color scale.
:param inline: Whether or not the figure is inline. If it's not then instead of getting plotted, this method will
return its figure.
:return: If `inline` is False, the underlying `matplotlib.figure` object. Else, nothing.
:return: The plot axis.
"""
# Apply filters and sorts, set up the figure.
df = nullity_filter(df, filter=filter, n=n, p=p)
Expand Down Expand Up @@ -405,11 +403,10 @@ def heatmap(df, inline=False,
return ax0


def dendrogram(df, method='average',
filter=None, n=0, p=0,
orientation=None, figsize=None,
fontsize=16, inline=False, ax=None
):
def dendrogram(
df, method='average', filter=None, n=0, p=0, orientation=None, figsize=None, fontsize=16,
ax=None
):
"""
Fits a `scipy` hierarchical clustering algorithm to the given DataFrame's variables and visualizes the results as
a `scipy` dendrogram.
Expand All @@ -427,9 +424,7 @@ def dendrogram(df, method='average',
:param fontsize: The figure's font size.
:param orientation: The way the dendrogram is oriented. Defaults to top-down if there are less than or equal to 50
columns and left-right if there are more.
:param inline: Whether or not the figure is inline. If it's not then instead of getting plotted, this method will
return its figure.
:return: If `inline` is False, the underlying `matplotlib.figure` object. Else, nothing.
:return: The plot axis.
"""
if not figsize:
if len(df.columns) <= 50 or orientation == 'top' or orientation == 'bottom':
Expand Down