Created
July 15, 2019 00:08
-
-
Save kperry2215/a539ef55fca70d9676d50b692ef32cc3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def generate_boxplot(df, x_variable): | |
""" | |
This function generates a basic histogram of a column's data, with | |
outliers removed | |
Arguments: | |
df: Pandas dataframe | |
x_variable: String. Name of the column that we want to generate | |
boxplot from | |
Outputs: | |
Box plot in console. | |
""" | |
plt.boxplot(list(df[x_variable].dropna()), showfliers=False) | |
plt.show() | |
... | |
#Execution in main script | |
generate_boxplot(dataframe, x_variable='TotalBaseNonWaterVolume') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment