






import pandas as pd
df = pd.read_csv("pokemon.csv")

dfs = df.describe()







Q1 = [(n+1)/4]th item
Q2 = [(n+1)/2]th item
Q3 = [3(n+1)/4]th item

lst = [4, 6, 7, 8, 10, 23, 34]

Q1 = lst[int((len(lst)+1)/4)-1]
print(Q1)
#6

Q2 = lst[int((len(lst)+1)/2)-1]
print(Q2)
#8

Q3 =lst[int(3*(len(lst)+1)/4)-1]
print(Q3)
#23


IQR = Q3-Q1
print(IQR)

minval = Q1-1.5*IQR
print(minval)

maxval = Q3+1.5*IQR
print(maxval) 


import numpy as np 
lst = [3, 4, 4, 5, 6, 8] 
print("\nOriginal array:") 
print(x) 

r0 = sum(lst)/len(lst)
print("\nMean: ", r0)
#Mean:  5.0


r1 = np.mean(lst)
print("\nMean: ", r1) 
#Mean:  5.0 
 
r2 = np.average(x) 
print("\nMean: ", r2) 
#Mean:  5.0

df['Total'].mean()
#435.1025


lst = [5,4,9,7,6]
mn = np.mean(lst)
print("\nMean: ", mn) 
#Mean:  6.2

med = np.median(lst)
print("\nMedian: ", med) 
#Median:  6.0

lst = [5,4,9,3,7,6]
mn = np.mean(lst)
print("\nMean: ", mn) 
#Mean:  5.666666666666667

med = np.median(lst)
print("\nMedian: ", med) 
#Median:  5.5

df['Total'].median()
#450.0

Sometimes there will be a huge difference between the mean and 
the median  

lst = [5,4,9,7,6,98]
mn = np.mean(lst)
print("\nMean: ", mn) 
#Mean:  21.5

med = np.median(lst)
print("\nMedian: ", med) 
#Median:  6.0

lst = [5,4,9,3,7,6]
mn = np.mean(lst)
print("\nMean: ", mn) 
#Mean:  5.666666666666667

med = np.median(lst)
print("\nMedian: ", med) 
#Median:  5.5


Mode : The most frequent value in the data distribution

md = df['Name'].mode()
print(md)
0                    Abomasnow
1      AbomasnowMega Abomasnow
2                         Abra
3                        Absol
4              AbsolMega Absol
 ::
 :
 
     
md = df['Type 1'].mode()
print(md)
0    Water
type(md)
#pandas.core.series.Series

md1 = df['Type 2'].mode()
print(md1)
0    Flying


r1= np.var(x) 
r2 = np.mean((x - np.mean(x)) ** 2 ) 
print("\nvariance: ", r1)
print("\nvariance: ", r2)

r1 = np.std(x) 
r2 = np.sqrt(np.mean((x - np.mean(x)) ** 2 )) 
print("\nstd: ", r1) 
print("\nstd: ", r2) 



from matplotlib import pyplot as plt
plt.plot([1,2,3],
         [4,5,1])
plt.show()

x = [5,2,7]
y = [2,16,4]
plt.plot(x,y)
plt.title('Info')
plt.ylabel('Y axis')
plt.xlabel('X axis')
plt.show()


from matplotlib import style
x = [5,8,10]
y = [12,16,6]
x2 = [6,9,11]
y2 = [6,15,7]
plt.plot(x,y,'g',label='line one', linewidth=5)
plt.plot(x2,y2,'c',label='line two',linewidth=5)
plt.title('Epic Info')
plt.ylabel('Y axis')
plt.xlabel('X axis')
plt.legend()
plt.grid(True,color='k')
plt.show()

plt.bar([0.25,1.25,2.25,3.25,4.25],
        [50,40,70,80,20],
label="BMW",width=.5)
plt.bar([.75,1.75,2.75,3.75,4.75],
        [80,20,20,50,60],
label="Audi", color='r',width=.5)
plt.legend()
plt.xlabel('Days')
plt.ylabel('Distance (kms)')
plt.title('Information')
plt.show()














