Python Visualization Flashcards

(40 cards)

1
Q

import matplotlib.pyplot as plt

A

Ikeliame matplot biblioteka

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

%matplotlib inline

A

Naudojama Jupyter Notebook ,kad iskart isvestu diagramas

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

plt.show

A

Rasome norint isvesti diagrama

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

functional ,nerekomenduojamas budas

plt.plot(x,y)
plt.xlabel(‘X Label’)
plt.ylabel(‘Y Label’)
plt.title(‘Title’)
plt.show()

A

Funkcionalus budas isvesti paprasta tiesine diagrama

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

plt.xlabel(‘X Label’)

A

Sukuriamas pavadinimas x asiai

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

plt.ylabel(‘Y Label’)

A

Sukuriamas pavadinimas y asiai

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

plt.title(‘Title’)

A

Sukuriamas pavadinimas diagramai

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Object oriantated
fig=plt.figure()

axes = fig.add_axes([0.1,0.1,0.8,0.8])

axes.plot(x,y)
axes.set_xlabel(‘X Label’)
axes.set_ylabel(‘Y Label’)
axes.set_title(‘Title’)

A

Rekomenduojamas budas kuriant diagramas

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

fig=plt.figure()

A

Sukuriama diagramos kintamasis

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

axes = fig.add_axes([0.1,0.1,0.8,0.8])

A

Pridedamos kordinaciu asys ir ju matmenys [x pradzia,y pradzia,ilgis,plotis]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

axes.plot(x,y)

A

I kordinaciu plokstuma iterpiama diagrama

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

fig,axes=plt.subplots(nrows=3,ncols=3)

A

Naudojama norint sukurti kelias vienodas kordinaciu plokstumas

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

plt.tight_layout()

A

Neleidzia overlappinti

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

fig,axes=plt.subplots(nrows=1,ncols=2)
for current_ax in axes:
current_ax.plot(x,y)

A

Galima iteruoti per cikla

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

fig,axes=plt.subplots(nrows=1,ncols=2)
axes[0].plot(x,y)
axes[0].set_title(‘First Plot’)
axes[1].plot(y,x)
axes[1].set_title(“Second Plot”)
plt.tight_layout

A

Galima pasirinkti i kuria kordinaciu plokstuma iterpti diagrama

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

fig=plt.figure(figsize=(8,2))

A

Leidzia nustatyti diagramos dydi

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

ax.legend()

fig=plt.figure()
ax=fig.add_axes([0,0,1,1])
ax.plot(x,x2,label=’X squared’)
ax.plot(x,x
3,label=”X cubed”)
ax.legend()

A

Norint iterpti legenda butinai reikia diagramas uzvadinti label

18
Q

import seaborn as sns

A

Importuojam seaborn biblioteka

19
Q

sns.displot(tips[‘total_bill’],kde=False,bins=40)

A

Sukuriame paprasta diagrama
kde= false nuima linija
bins nustato diagramos bar dydi

20
Q

sns.jointplot(x=’total_bill’,y=’tip’,data=tips,kind=’hex’)

A

Sukuriamos viena didele diagrama ant kurios yra 3 mazos .ant x ir y asies paprasta stulpeline diagrama o viduje scatter plot .Scatter plot galima pakeisti i hex,kde ,reg… naudojant kind=’ ‘

21
Q

sns.pairplot(tips,hue=’sex’,palette=’coolwarm’)

A

Sukuria 9 diagramas 6 scatter ir 3 paprastas
galima pakonkretinti kokius duomenis naudoti su hue ,o palette parinkti spalvas

22
Q

sns.rugplot(tips[‘total_bill’])

A

Sukuria diagrama su mazais stulpeliais ant x asies

23
Q

sns.barplot(x=’sex’,y=’total_bill’,data=tips,estimator=np.std)

A

Sukuria bar diagrama
estimator =’ ‘ Galima panaudoti kazkokia sukurta funkcija

24
Q

sns.boxplot(x=’day’,y=’total_bill’,data=tips,hue=’smoker’)

A

Sukuria box diagrama

25
sns.violinplot(x='day',y='total_bill',data=tips,hue='sex',split=True)
Sukuria violin diagrama .split=' ' sulygina stulpeliu duomenis
26
sns.stripplot(x='day',y='total_bill',data=tips,jitter=True,hue='sex',split=True)
Sukuria diagrama is taskeliu
27
sns.swarmplot(x='day',y='total_bill',data=tips,color='black') sns.violinplot(x='day',y='total_bill',data=tips)
Sukuria dvi diagramos ,kurios susijungia
28
sns.factorplot(x='day',y='total_bill',data=tips,kind='bar')
Sukuria tam tikra diagrama naudojant kind = ' '
29
sns.heatmap(tc,annot=True,cmap='coolwarm')
Sukuria heatmap
30
fp=flights.pivot_table(index='month',columns='year',values='passengers')
Sukuriama isrusiuota matrixa
31
sns.heatmap(fp,cmap='magma',linecolor='green',linewidths=1)
Sukuria heatmap cmap =' ' spalva linecolor=' ' atskirimo liniju spalva
32
sns.clustermap(fp,cmap='coolwarm',standard_scale=1)
Sukuriama clustermap
33
g=sns.PairGrid(iris) g.map_diag(sns.distplot) g.map_upper(plt.scatter) g.map_lower(sns.kdeplot)
Sukuria 16 diagramu g=sns.PairGrid() sukuria tesiog 16 tusciu grid g.map_diag(sns.distplot) uzpildo grid istrizaine pasirinktom diagramom g.map_upper(plt.scatter) uzpildo desni virsutini trikampi(6 desinies puses grid laukelius) g.map_lower(sns.kdeplot) uzplido kairinius apatini trikampio laukelius
34
g= sns.FacetGrid(data=tips,col='time',row='smoker') g.map(sns.distplot,'total_bill')
Sukuriamas diagramu grid ,pagal pasirinkta stulpeli ir eilute
35
g= sns.FacetGrid(data=tips,col='time',row='smoker') g.map(plt.scatter,'total_bill','tip')
Sukuriamas diagramu grid ,pagal pasirinkta stulpeli ir eilute ,tik kad uzpildome scatter diagrama
36
sns.lmplot(x='total_bill',y='tip',data=tips,hue='sex',markers=['o','v'],scatter_kws={'s':100})
Sukuria linear regression rodancia diagrama .
37
sns.lmplot(x='total_bill',y='tip',data=tips,col='day',row='time',hue='sex',aspect=0.6,size=8)
Sukuria kelias linear regression rodancia diagrama .
38
sns.set_style('ticks')
Nustato ,kad diagrama turetu remus
39
sns.despine(left=True,bottom=True)
Nuema remus
40
sns.set_context('poster',font_scale=1)
Leidzia pasirinkti dizaina (notebook,poster)