#!/usr/bin/env python3 # -*- coding: utf-8 -*- import pandas as pa import numpy import matplotlib.pyplot as plt
l = [[1,2,3],[1,2,5],[2,4,8],[1,2,2],[3,2,1]] nazwaKol = [„K1”, „K2”, „K3”] #dane = numpy.array(l) df = pa.DataFrame(numpy.array(l),columns=nazwaKol)#, index=[„w1″,”w2″,”w3″,”w4”])
print(df.describe()) print(„xxxxxxxxxxx”) print(df.median()) print(„xxxxxxxxxxx”) print(df.sum()) print(„xxxxxxxxxxx”) print(df) df.hist() plt.show() print(„xxxxxxxxxxx”) df.plot() plt.show() print(„xxxxxxxxxxx”) df.plot(kind=”box”) plt.show() print(„xxxxxxxxxxx”)
from pandas.plotting import scatter_matrix as sm sm(df) plt.show() sm(df,figsize=[8,6],s=500)
Część (II) — przykład z zajęć (1)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import pandas as pa
import numpy
import matplotlib.pyplot as plt
l = [[1,2,3],[1,2,5],[2,4,8],[1,2,2],[3,2,1]]
nazwaKol = [„K1”, „K2”, „K3”]
#dane = numpy.array(l)
df = pa.DataFrame(numpy.array(l),columns=nazwaKol)#, index=[„w1″,”w2″,”w3″,”w4”])
print(df.describe())
print(„xxxxxxxxxxx”)
print(df.median())
print(„xxxxxxxxxxx”)
print(df.sum())
print(„xxxxxxxxxxx”)
print(df)
df.hist()
plt.show()
print(„xxxxxxxxxxx”)
df.plot()
plt.show()
print(„xxxxxxxxxxx”)
df.plot(kind=”box”)
plt.show()
print(„xxxxxxxxxxx”)
from pandas.plotting import scatter_matrix as sm
sm(df)
plt.show()
sm(df,figsize=[8,6],s=500)