Skip to content

Commit

Permalink
Merge pull request #98 from UBC-MDS/viz-update
Browse files Browse the repository at this point in the history
Update visualise.py to include display argument
  • Loading branch information
scout-mckee authored Feb 2, 2024
2 parents 7fce112 + adc971b commit 503ea70
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/datexplore/visualise.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
import seaborn as sns
import matplotlib.pyplot as plt

def visualise(df):
def visualise(df, display = False):
"""This function generates visualizations for a pandas DataFrame to identify patterns in missing values, correlation between variables, and distribution of variables and variable pairs.
This function creates three types of plots:
1. A heatmap of missing values: Each cell in the heatmap represents a value in the DataFrame. Cells are colored differently to indicate whether the value is missing or not.
This helps in identifying patterns or areas with missing data.
This helps in identifying patterns or areas with missing data.
2. A correlation heatmap: This heatmap shows the correlation coefficients between all pairs of columns in the DataFrame.
High positive or negative values indicate strong relationships, while values close to zero suggest weak relationship. This is useful for understanding the relationships between variables.
3. A pairplot: This creates a grid of scatter plots for each pair of variables in the DataFrame. It helps in visualizing the distribution of individual variables and the relationships between them.
Expand Down Expand Up @@ -47,7 +47,7 @@ def visualise(df):
plt.title('Correlation Heatmap of Variables in DataFrame')
if display==True:
plt.show()

sns.pairplot(df)
plt.figure(figsize=(10, 4))
if display==True:
Expand Down

0 comments on commit 503ea70

Please sign in to comment.