In [1]:
import numpy as np
import pandas as pd
df = pd.read_csv('E:/Unilever/data1.csv')
In [2]:
import plotly.graph_objs as go
from plotly.offline import iplot
In [3]:
fig = go.Figure([
go.Bar(x = df["Customer Group"].unique(),
y = df.groupby(["Customer Group"])["Sales Org Code"].count(),
name = "Customer Group",
marker = dict(color = 'rgba(255, 174, 255)',
line=dict(color='rgb(0,0,0)',width=1.5)))
])
fig.update_layout(title=go.layout.Title(text="Customer Groups Distribution"))
fig.show()
This graph depicts the Customer Group variations wherein Distributors are the maximum in the given data!
In [4]:
fig = go.Figure([
go.Bar(x = df["Customer Group new"].unique(),
y = df.groupby(["Customer Group new"])["Sales Org Code"].count(),
name = "Customer Group",
marker = dict(color = 'rgba(255, 174, 255)',
line=dict(color='rgb(0,0,0)',width=1.5)))
])
fig.update_layout(title=go.layout.Title(text="New Customer Groups Distribution"))
fig.show()
A graph on 'New Customer Group' variations wherein Distr are the maximum again!
In [5]:
fig = go.Figure([
go.Bar(x = df["Customer Group by Directors"].unique(),
y = df.groupby(["Customer Group by Directors"])["Sales Org Code"].count(),
name = "Customer Group",
marker = dict(color = 'rgba(255, 174, 255)',
line=dict(color='rgb(0,0,0)',width=1.5)))
])
fig.update_layout(title=go.layout.Title(text="Customer Group by Directors Distribution"))
fig.show()
A graph on 'Director Group' variations wherein DT Director is the max!
In [6]:
df1 = df[df["Master Customer Name"] == "IVANOVA ELENA NIKOLAEVNA"]
'''Considering just one customer for the ease of representation here!'''
fig = go.Figure([
go.Bar(
x=df1["Category"].unique(),
y=df1.groupby(["Category"])["Sal QTY"].sum(),
name = "Packages sold",
marker = dict(color = 'rgba(16, 112, 2, 0.8)'))
])
fig.update_layout(title=go.layout.Title(text="Category Wise Packages Sold for a Customer"))
fig.show()
In [7]:
fig = go.Figure([
go.Bar(
x=df1["Category"].unique(),
y=df1.groupby(["Category"])["Sal GSV"].sum(),
name = "Total Sales GSV",
marker = dict(color = 'rgba(16, 112, 2, 0.8)'))
])
fig.update_layout(title=go.layout.Title(text="Category Wise Sales GSV for a Customer"))
fig.show()
In [8]:
fig = go.Figure([
go.Bar(
x=df1["Category"].unique(),
y=df1.groupby(["Category"])["Sal NIV"].sum(),
name = "Total Sales GSV",
marker = dict(color = 'rgba(16, 112, 2, 0.8)'))
])
fig.update_layout(title=go.layout.Title(text="Category Wise Sales NIV for a Customer"))
fig.show()