### How to write equations in matplotlib.pyplot

December 11, 2019

How to write equations in matplotlib.pyplot¶ Practice makes perfect In [4]: import pandas as pd import matplotlib.pyplot as plt In [5]: a = r’3 = frac{12}{4}’ ax […]

### Perfect Plots: Bubble Plot

November 7, 2019

In [1]: import pandas as pd import matplotlib.pyplot as plt import numpy as np Autos Source of data: https://datahub.io/machine-learning/autos In [2]: df2= pd.read_csv(‘c:/1/autos.csv’) df2.head() Out[2]: Unnamed: […]

### Perfect Plots: Bar plots

November 5, 2019

In [1]: import pandas as pd import matplotlib.pyplot as plt import numpy as np import matplotlib.patches as mpatches Car statistics In [2]: # Prepare Data df = […]

### Perfect Plots: Subplots

November 5, 2019

In [1]: import pandas as pd import matplotlib.pyplot as plt import numpy as np Economics In [2]: df=pd.read_csv(‘c:/1/economics.txt’) df.head() Out[2]: date pce pop psavert uempmed unemploy […]

### Perfect Plots: Combiplot

November 5, 2019

Global market sales Source of data: https://github.com/vkrit/data-science-class/blob/master/WA_Fn-UseC_-Sales-Win-Loss.csv In [1]: import pandas as pd import matplotlib.pyplot as plt import numpy as np import seaborn as sns df […]

### Perfect Plots: Individuals Control Chart I-MR

November 5, 2019

Energy Source of data: https://github.com/pyviz/holoviews/blob/master/examples/assets/energy.csv In [1]: import pandas as pd import matplotlib.pyplot as plt import numpy as np In [2]: df=pd.read_csv(‘c:/2/Energy.csv’) df.head() Out[2]: Unnamed: 0 Date […]

### Perfect Plots: Violinplot

October 31, 2019

In [1]: import pandas as pd import matplotlib.pyplot as plt import numpy as np import matplotlib.patches as mpatches Titanic disaster Source of data: https://www.kaggle.com/shivamp629/traincsv In [2]: […]

### Dendrogram and clustering 3d

October 25, 2019

In [1]: import scipy.cluster.hierarchy as shc import pandas as pd import matplotlib.pyplot as plt # Import Data df = pd.read_csv(‘c:/1/USArrests.csv’) USArrests Source of data: https://www.kaggle.com/deepakg/usarrests […]

### Perfect Plots: Calendarplot

October 24, 2019

In [1]: import matplotlib as mpl import calmap import pandas as pd import matplotlib.pyplot as plt yahoo In [2]: df = pd.read_csv(‘c:/1/yahoo.txt’, parse_dates=[‘date’]) df.set_index(‘date’, inplace=True) df.head(3) […]

### Methods of indication optimal number of clusters: Dendrogram and Elbow Method

October 24, 2019

In [1]: import pandas as pd from sklearn.cluster import KMeans import matplotlib.pyplot as plt Wholesale customers data The dataset refers to clients of a wholesale […]