Created
May 23, 2019 20:35
-
-
Save pjastr/6cc61c9d02a8afc73d9ebdf23eac3278 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import matplotlib.pyplot as plt | |
import numpy as np | |
data = pd.read_csv("liga.csv", index_col="Klub") | |
# usuniecie Lp | |
data2 = data.drop(columns="Lp") | |
bilansBramek = data2.iloc[:, 3] - data2.iloc[:, 4] | |
data2.insert(loc=5, column='Bilans bramek', value=bilansBramek) | |
porazki = bilansBramek = data2.iloc[:, -2] - data2.iloc[:, -1] | |
data2.insert(loc=8, column='Porażki', value=porazki) | |
klubyUnder500 = data2[data2["Porażki"] < 500] | |
# wykres słupkowy | |
sezony = data2["Sezon"] | |
slupki = data2.index | |
y_pos = np.arange(len(slupki)) | |
plt.subplot(2, 1, 1) | |
# wykres punktowy | |
plt.bar(y_pos, sezony) | |
plt.xticks(y_pos, slupki, rotation='vertical') | |
plt.subplot(2, 1, 2) | |
plt.plot(slupki, bilansBramek, linestyle='none', marker='o') | |
plt.xticks(rotation='vertical') | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment