Skip to content

Instantly share code, notes, and snippets.

@pjastr
Created May 23, 2019 20:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pjastr/6cc61c9d02a8afc73d9ebdf23eac3278 to your computer and use it in GitHub Desktop.
Save pjastr/6cc61c9d02a8afc73d9ebdf23eac3278 to your computer and use it in GitHub Desktop.
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