Skip to content

Instantly share code, notes, and snippets.

@zenUnicorn
Created November 14, 2022 15:36
Show Gist options
  • Save zenUnicorn/ab09f13e709c1f27568ab6f040f78b09 to your computer and use it in GitHub Desktop.
Save zenUnicorn/ab09f13e709c1f27568ab6f040f78b09 to your computer and use it in GitHub Desktop.
# importing the required libarary
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
df = pd.read_excel("online_retail_II.xlsx")
df.head()
#Bar chart visualisation
mask_df = df["Country"].value_counts().head(10)
fig1 = plt.figure(figsize=(12, 10))
plt.bar(x = mask_df.index, height=mask_df, color="sienna")
plt.xlabel("Country")
plt.ylabel("Counts")
plt.title("Numbers of Orders from Countries Over the Years")
plt.xticks(rotation=45);
#Histogram visualization
fig2 = plt.figure(figsize=(12, 10))
sns.histplot(df["InvoiceDate"], color="darkslategrey", bins=50)
plt.title("Distribution of the Invoice Date");
# import comet_ml at the top of your file
from comet_ml import Experiment
# Create an experiment with your api key
experiment = Experiment(
api_key = "your API key",
project_name = "viz",
workspace="zenunicorn",
)
#logging the viz to comet
experiment.log_figure(figure_name="Matplotlib Viz", figure=fig1)
experiment.log_figure(figure_name= "Seaborn Viz", figure=fig2)
#always end your experiment
experiment.end()
@zenUnicorn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment