Histogramlar

Finans için Python’a Giriş

Adina Howe

Instructor

Finansal analiz için neden histogram?

histogram

Finans için Python’a Giriş

Histogramlar ve Veri

  • Veriniz çarpık mı?
  • Veriniz ortalama etrafında mı toplanıyor?
  • Aykırı değerler var mı?
Finans için Python’a Giriş

Histogramlar ve matplotlib.pyplot

import matplotlib.pyplot as plt
plt.hist(x=prices, bins=3)
plt.show()

hist1

Finans için Python’a Giriş

Kutu (bin) sayısını değiştirme

import matplotlib.pyplot as plt
plt.hist(prices, bins=6)
plt.show()

hist2

Finans için Python’a Giriş

Histogram verisini normalleştirme

import matplotlib.pyplot as plt
plt.hist(prices, bins=6, normed=1)
plt.show()

normalize

Finans için Python’a Giriş

Grafikte histogramları katmanlama

import matplotlib.pyplot as plt
plt.hist(x=prices, bins=6, normed=1)
plt.hist(x=prices_new, bins=6, normed=1)
plt.show()
Finans için Python’a Giriş

Histogram sonucu

iki_hist_normed

Finans için Python’a Giriş

Alfa: Histogram saydamlığını değiştirme

import matplotlib.pyplot as plt
plt.hist(x=prices, bins=6, normed=1, alpha=0.5)
plt.hist(x=prices_new, bins=6, normed=1, alpha=0.5)
plt.show()
Finans için Python’a Giriş

Histogram sonucu

iki-hist-saydam

Finans için Python’a Giriş

Gösterge ekleme

import matplotlib.pyplot as plt
plt.hist(x=prices, bins=6, normed=1, alpha=0.5, label="Prices 1")
plt.hist(x=prices_new, bins=6, normed=1, alpha=0.5, label="Prices New")
plt.legend()
plt.show()
Finans için Python’a Giriş

Histogram sonucu

şık hist

Finans için Python’a Giriş

Hadi pratik yapalım!

Finans için Python’a Giriş

Preparing Video For Download...