astetik 1.14__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- astetik/__init__.py +55 -0
- astetik/extras/__init__.py +0 -0
- astetik/extras/clean_notebook.sh +12 -0
- astetik/extras/countries.csv +250 -0
- astetik/extras/countries.dbf +0 -0
- astetik/extras/countries.shp +0 -0
- astetik/extras/countries.shx +0 -0
- astetik/extras/table.html +95 -0
- astetik/plots/__init__.py +0 -0
- astetik/plots/animate.py +62 -0
- astetik/plots/bar.py +165 -0
- astetik/plots/bargrid.py +158 -0
- astetik/plots/bartwo.py +142 -0
- astetik/plots/box.py +146 -0
- astetik/plots/compare.py +169 -0
- astetik/plots/corr.py +171 -0
- astetik/plots/count.py +126 -0
- astetik/plots/grid.py +140 -0
- astetik/plots/hist.py +157 -0
- astetik/plots/kde.py +139 -0
- astetik/plots/line.py +316 -0
- astetik/plots/multicount.py +140 -0
- astetik/plots/multikde.py +166 -0
- astetik/plots/oned.py +21 -0
- astetik/plots/overlap.py +179 -0
- astetik/plots/pie.py +150 -0
- astetik/plots/regs.py +147 -0
- astetik/plots/roc.py +180 -0
- astetik/plots/scat.py +155 -0
- astetik/plots/strip.py +150 -0
- astetik/plots/swarm.py +153 -0
- astetik/plots/twod.py +25 -0
- astetik/plots/violin.py +140 -0
- astetik/plots/world.py +159 -0
- astetik/style/__init__.py +0 -0
- astetik/style/color_picker.py +155 -0
- astetik/style/formats.py +26 -0
- astetik/style/legend.py +12 -0
- astetik/style/random_colors.py +14 -0
- astetik/style/sizer.py +10 -0
- astetik/style/style.py +137 -0
- astetik/style/template.py +96 -0
- astetik/style/titles.py +46 -0
- astetik/tables/__init__.py +0 -0
- astetik/tables/table.py +161 -0
- astetik/tables/text.py +54 -0
- astetik/utils/__init__.py +0 -0
- astetik/utils/country_code.py +28 -0
- astetik/utils/datetime.py +97 -0
- astetik/utils/exceptions.py +8 -0
- astetik/utils/gui.py +24 -0
- astetik/utils/load_data.py +8 -0
- astetik/utils/outliers.py +23 -0
- astetik/utils/transform.py +205 -0
- astetik/utils/utils.py +308 -0
- astetik-1.14.dist-info/METADATA +162 -0
- astetik-1.14.dist-info/RECORD +59 -0
- astetik-1.14.dist-info/WHEEL +5 -0
- astetik-1.14.dist-info/licenses/LICENSE +21 -0
astetik/__init__.py
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# PLOTS
|
|
2
|
+
from .plots.corr import corr
|
|
3
|
+
from .plots.hist import hist
|
|
4
|
+
from .plots.kde import kde
|
|
5
|
+
from .plots.pie import pie
|
|
6
|
+
from .plots.swarm import swarm
|
|
7
|
+
from .plots.scat import scat
|
|
8
|
+
from .plots.line import line
|
|
9
|
+
from .plots.grid import grid
|
|
10
|
+
from .plots.box import box
|
|
11
|
+
from .plots.violin import violin
|
|
12
|
+
from .plots.strip import strip
|
|
13
|
+
from .plots.count import count
|
|
14
|
+
from .plots.bargrid import bargrid
|
|
15
|
+
from .plots.overlap import overlap
|
|
16
|
+
from .plots.multikde import multikde
|
|
17
|
+
from .plots.compare import compare
|
|
18
|
+
from .plots.multicount import multicount
|
|
19
|
+
from .plots.bar import bar
|
|
20
|
+
from .plots.bartwo import bartwo
|
|
21
|
+
from .plots.animate import Animation
|
|
22
|
+
from .plots.world import world
|
|
23
|
+
from .plots.regs import regs
|
|
24
|
+
from .plots.roc import roc
|
|
25
|
+
# from .plots.words import words
|
|
26
|
+
|
|
27
|
+
from .utils.gui import toggle as toggle
|
|
28
|
+
from .utils.gui import warning as warning
|
|
29
|
+
|
|
30
|
+
# TABLES
|
|
31
|
+
from .tables.table import table
|
|
32
|
+
from .tables.text import text
|
|
33
|
+
# from .tables.timeseries import timeseries
|
|
34
|
+
|
|
35
|
+
try:
|
|
36
|
+
del plots
|
|
37
|
+
except:
|
|
38
|
+
pass
|
|
39
|
+
|
|
40
|
+
try:
|
|
41
|
+
del style
|
|
42
|
+
except:
|
|
43
|
+
pass
|
|
44
|
+
|
|
45
|
+
try:
|
|
46
|
+
del tables
|
|
47
|
+
except:
|
|
48
|
+
pass
|
|
49
|
+
|
|
50
|
+
try:
|
|
51
|
+
del utils
|
|
52
|
+
except:
|
|
53
|
+
pass
|
|
54
|
+
|
|
55
|
+
__VERSION__ = '1.14'
|
|
File without changes
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Jupyter HTML Output Cleaner
|
|
4
|
+
# removes 'out' and 'toggle code cells' from html files in a given folder.
|
|
5
|
+
|
|
6
|
+
while read FILE
|
|
7
|
+
do
|
|
8
|
+
|
|
9
|
+
sed 's/<a href="javascript:code_toggle()">toggle code cells<\/a>//' $FILE > temp.html
|
|
10
|
+
sed 's/D84315/ffffff/' temp.html > $FILE
|
|
11
|
+
|
|
12
|
+
done < <(ls *.html)
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
name,alpha-2,alpha-3,country-code,iso_3166-2,region,sub-region,intermediate-region,region-code,sub-region-code,intermediate-region-code
|
|
2
|
+
Afghanistan,AF,AFG,004,ISO 3166-2:AF,Asia,Southern Asia,"",142,034,""
|
|
3
|
+
Åland Islands,AX,ALA,248,ISO 3166-2:AX,Europe,Northern Europe,"",150,154,""
|
|
4
|
+
Albania,AL,ALB,008,ISO 3166-2:AL,Europe,Southern Europe,"",150,039,""
|
|
5
|
+
Algeria,DZ,DZA,012,ISO 3166-2:DZ,Africa,Northern Africa,"",002,015,""
|
|
6
|
+
American Samoa,AS,ASM,016,ISO 3166-2:AS,Oceania,Polynesia,"",009,061,""
|
|
7
|
+
Andorra,AD,AND,020,ISO 3166-2:AD,Europe,Southern Europe,"",150,039,""
|
|
8
|
+
Angola,AO,AGO,024,ISO 3166-2:AO,Africa,Sub-Saharan Africa,Middle Africa,002,202,017
|
|
9
|
+
Anguilla,AI,AIA,660,ISO 3166-2:AI,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
|
10
|
+
Antarctica,AQ,ATA,010,ISO 3166-2:AQ,"","","","","",""
|
|
11
|
+
Antigua and Barbuda,AG,ATG,028,ISO 3166-2:AG,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
|
12
|
+
Argentina,AR,ARG,032,ISO 3166-2:AR,Americas,Latin America and the Caribbean,South America,019,419,005
|
|
13
|
+
Armenia,AM,ARM,051,ISO 3166-2:AM,Asia,Western Asia,"",142,145,""
|
|
14
|
+
Aruba,AW,ABW,533,ISO 3166-2:AW,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
|
15
|
+
Australia,AU,AUS,036,ISO 3166-2:AU,Oceania,Australia and New Zealand,"",009,053,""
|
|
16
|
+
Austria,AT,AUT,040,ISO 3166-2:AT,Europe,Western Europe,"",150,155,""
|
|
17
|
+
Azerbaijan,AZ,AZE,031,ISO 3166-2:AZ,Asia,Western Asia,"",142,145,""
|
|
18
|
+
Bahamas,BS,BHS,044,ISO 3166-2:BS,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
|
19
|
+
Bahrain,BH,BHR,048,ISO 3166-2:BH,Asia,Western Asia,"",142,145,""
|
|
20
|
+
Bangladesh,BD,BGD,050,ISO 3166-2:BD,Asia,Southern Asia,"",142,034,""
|
|
21
|
+
Barbados,BB,BRB,052,ISO 3166-2:BB,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
|
22
|
+
Belarus,BY,BLR,112,ISO 3166-2:BY,Europe,Eastern Europe,"",150,151,""
|
|
23
|
+
Belgium,BE,BEL,056,ISO 3166-2:BE,Europe,Western Europe,"",150,155,""
|
|
24
|
+
Belize,BZ,BLZ,084,ISO 3166-2:BZ,Americas,Latin America and the Caribbean,Central America,019,419,013
|
|
25
|
+
Benin,BJ,BEN,204,ISO 3166-2:BJ,Africa,Sub-Saharan Africa,Western Africa,002,202,011
|
|
26
|
+
Bermuda,BM,BMU,060,ISO 3166-2:BM,Americas,Northern America,"",019,021,""
|
|
27
|
+
Bhutan,BT,BTN,064,ISO 3166-2:BT,Asia,Southern Asia,"",142,034,""
|
|
28
|
+
Bolivia (Plurinational State of),BO,BOL,068,ISO 3166-2:BO,Americas,Latin America and the Caribbean,South America,019,419,005
|
|
29
|
+
"Bonaire, Sint Eustatius and Saba",BQ,BES,535,ISO 3166-2:BQ,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
|
30
|
+
Bosnia and Herzegovina,BA,BIH,070,ISO 3166-2:BA,Europe,Southern Europe,"",150,039,""
|
|
31
|
+
Botswana,BW,BWA,072,ISO 3166-2:BW,Africa,Sub-Saharan Africa,Southern Africa,002,202,018
|
|
32
|
+
Bouvet Island,BV,BVT,074,ISO 3166-2:BV,Americas,Latin America and the Caribbean,South America,019,419,005
|
|
33
|
+
Brazil,BR,BRA,076,ISO 3166-2:BR,Americas,Latin America and the Caribbean,South America,019,419,005
|
|
34
|
+
British Indian Ocean Territory,IO,IOT,086,ISO 3166-2:IO,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
|
|
35
|
+
Brunei Darussalam,BN,BRN,096,ISO 3166-2:BN,Asia,South-eastern Asia,"",142,035,""
|
|
36
|
+
Bulgaria,BG,BGR,100,ISO 3166-2:BG,Europe,Eastern Europe,"",150,151,""
|
|
37
|
+
Burkina Faso,BF,BFA,854,ISO 3166-2:BF,Africa,Sub-Saharan Africa,Western Africa,002,202,011
|
|
38
|
+
Burundi,BI,BDI,108,ISO 3166-2:BI,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
|
|
39
|
+
Cabo Verde,CV,CPV,132,ISO 3166-2:CV,Africa,Sub-Saharan Africa,Western Africa,002,202,011
|
|
40
|
+
Cambodia,KH,KHM,116,ISO 3166-2:KH,Asia,South-eastern Asia,"",142,035,""
|
|
41
|
+
Cameroon,CM,CMR,120,ISO 3166-2:CM,Africa,Sub-Saharan Africa,Middle Africa,002,202,017
|
|
42
|
+
Canada,CA,CAN,124,ISO 3166-2:CA,Americas,Northern America,"",019,021,""
|
|
43
|
+
Cayman Islands,KY,CYM,136,ISO 3166-2:KY,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
|
44
|
+
Central African Republic,CF,CAF,140,ISO 3166-2:CF,Africa,Sub-Saharan Africa,Middle Africa,002,202,017
|
|
45
|
+
Chad,TD,TCD,148,ISO 3166-2:TD,Africa,Sub-Saharan Africa,Middle Africa,002,202,017
|
|
46
|
+
Chile,CL,CHL,152,ISO 3166-2:CL,Americas,Latin America and the Caribbean,South America,019,419,005
|
|
47
|
+
China,CN,CHN,156,ISO 3166-2:CN,Asia,Eastern Asia,"",142,030,""
|
|
48
|
+
Christmas Island,CX,CXR,162,ISO 3166-2:CX,Oceania,Australia and New Zealand,"",009,053,""
|
|
49
|
+
Cocos (Keeling) Islands,CC,CCK,166,ISO 3166-2:CC,Oceania,Australia and New Zealand,"",009,053,""
|
|
50
|
+
Colombia,CO,COL,170,ISO 3166-2:CO,Americas,Latin America and the Caribbean,South America,019,419,005
|
|
51
|
+
Comoros,KM,COM,174,ISO 3166-2:KM,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
|
|
52
|
+
Congo,CG,COG,178,ISO 3166-2:CG,Africa,Sub-Saharan Africa,Middle Africa,002,202,017
|
|
53
|
+
Congo (Democratic Republic of the),CD,COD,180,ISO 3166-2:CD,Africa,Sub-Saharan Africa,Middle Africa,002,202,017
|
|
54
|
+
Cook Islands,CK,COK,184,ISO 3166-2:CK,Oceania,Polynesia,"",009,061,""
|
|
55
|
+
Costa Rica,CR,CRI,188,ISO 3166-2:CR,Americas,Latin America and the Caribbean,Central America,019,419,013
|
|
56
|
+
Côte d'Ivoire,CI,CIV,384,ISO 3166-2:CI,Africa,Sub-Saharan Africa,Western Africa,002,202,011
|
|
57
|
+
Croatia,HR,HRV,191,ISO 3166-2:HR,Europe,Southern Europe,"",150,039,""
|
|
58
|
+
Cuba,CU,CUB,192,ISO 3166-2:CU,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
|
59
|
+
Curaçao,CW,CUW,531,ISO 3166-2:CW,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
|
60
|
+
Cyprus,CY,CYP,196,ISO 3166-2:CY,Asia,Western Asia,"",142,145,""
|
|
61
|
+
Czechia,CZ,CZE,203,ISO 3166-2:CZ,Europe,Eastern Europe,"",150,151,""
|
|
62
|
+
Denmark,DK,DNK,208,ISO 3166-2:DK,Europe,Northern Europe,"",150,154,""
|
|
63
|
+
Djibouti,DJ,DJI,262,ISO 3166-2:DJ,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
|
|
64
|
+
Dominica,DM,DMA,212,ISO 3166-2:DM,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
|
65
|
+
Dominican Republic,DO,DOM,214,ISO 3166-2:DO,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
|
66
|
+
Ecuador,EC,ECU,218,ISO 3166-2:EC,Americas,Latin America and the Caribbean,South America,019,419,005
|
|
67
|
+
Egypt,EG,EGY,818,ISO 3166-2:EG,Africa,Northern Africa,"",002,015,""
|
|
68
|
+
El Salvador,SV,SLV,222,ISO 3166-2:SV,Americas,Latin America and the Caribbean,Central America,019,419,013
|
|
69
|
+
Equatorial Guinea,GQ,GNQ,226,ISO 3166-2:GQ,Africa,Sub-Saharan Africa,Middle Africa,002,202,017
|
|
70
|
+
Eritrea,ER,ERI,232,ISO 3166-2:ER,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
|
|
71
|
+
Estonia,EE,EST,233,ISO 3166-2:EE,Europe,Northern Europe,"",150,154,""
|
|
72
|
+
Ethiopia,ET,ETH,231,ISO 3166-2:ET,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
|
|
73
|
+
Falkland Islands (Malvinas),FK,FLK,238,ISO 3166-2:FK,Americas,Latin America and the Caribbean,South America,019,419,005
|
|
74
|
+
Faroe Islands,FO,FRO,234,ISO 3166-2:FO,Europe,Northern Europe,"",150,154,""
|
|
75
|
+
Fiji,FJ,FJI,242,ISO 3166-2:FJ,Oceania,Melanesia,"",009,054,""
|
|
76
|
+
Finland,FI,FIN,246,ISO 3166-2:FI,Europe,Northern Europe,"",150,154,""
|
|
77
|
+
France,FR,FRA,250,ISO 3166-2:FR,Europe,Western Europe,"",150,155,""
|
|
78
|
+
French Guiana,GF,GUF,254,ISO 3166-2:GF,Americas,Latin America and the Caribbean,South America,019,419,005
|
|
79
|
+
French Polynesia,PF,PYF,258,ISO 3166-2:PF,Oceania,Polynesia,"",009,061,""
|
|
80
|
+
French Southern Territories,TF,ATF,260,ISO 3166-2:TF,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
|
|
81
|
+
Gabon,GA,GAB,266,ISO 3166-2:GA,Africa,Sub-Saharan Africa,Middle Africa,002,202,017
|
|
82
|
+
Gambia,GM,GMB,270,ISO 3166-2:GM,Africa,Sub-Saharan Africa,Western Africa,002,202,011
|
|
83
|
+
Georgia,GE,GEO,268,ISO 3166-2:GE,Asia,Western Asia,"",142,145,""
|
|
84
|
+
Germany,DE,DEU,276,ISO 3166-2:DE,Europe,Western Europe,"",150,155,""
|
|
85
|
+
Ghana,GH,GHA,288,ISO 3166-2:GH,Africa,Sub-Saharan Africa,Western Africa,002,202,011
|
|
86
|
+
Gibraltar,GI,GIB,292,ISO 3166-2:GI,Europe,Southern Europe,"",150,039,""
|
|
87
|
+
Greece,GR,GRC,300,ISO 3166-2:GR,Europe,Southern Europe,"",150,039,""
|
|
88
|
+
Greenland,GL,GRL,304,ISO 3166-2:GL,Americas,Northern America,"",019,021,""
|
|
89
|
+
Grenada,GD,GRD,308,ISO 3166-2:GD,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
|
90
|
+
Guadeloupe,GP,GLP,312,ISO 3166-2:GP,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
|
91
|
+
Guam,GU,GUM,316,ISO 3166-2:GU,Oceania,Micronesia,"",009,057,""
|
|
92
|
+
Guatemala,GT,GTM,320,ISO 3166-2:GT,Americas,Latin America and the Caribbean,Central America,019,419,013
|
|
93
|
+
Guernsey,GG,GGY,831,ISO 3166-2:GG,Europe,Northern Europe,Channel Islands,150,154,830
|
|
94
|
+
Guinea,GN,GIN,324,ISO 3166-2:GN,Africa,Sub-Saharan Africa,Western Africa,002,202,011
|
|
95
|
+
Guinea-Bissau,GW,GNB,624,ISO 3166-2:GW,Africa,Sub-Saharan Africa,Western Africa,002,202,011
|
|
96
|
+
Guyana,GY,GUY,328,ISO 3166-2:GY,Americas,Latin America and the Caribbean,South America,019,419,005
|
|
97
|
+
Haiti,HT,HTI,332,ISO 3166-2:HT,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
|
98
|
+
Heard Island and McDonald Islands,HM,HMD,334,ISO 3166-2:HM,Oceania,Australia and New Zealand,"",009,053,""
|
|
99
|
+
Holy See,VA,VAT,336,ISO 3166-2:VA,Europe,Southern Europe,"",150,039,""
|
|
100
|
+
Honduras,HN,HND,340,ISO 3166-2:HN,Americas,Latin America and the Caribbean,Central America,019,419,013
|
|
101
|
+
Hong Kong,HK,HKG,344,ISO 3166-2:HK,Asia,Eastern Asia,"",142,030,""
|
|
102
|
+
Hungary,HU,HUN,348,ISO 3166-2:HU,Europe,Eastern Europe,"",150,151,""
|
|
103
|
+
Iceland,IS,ISL,352,ISO 3166-2:IS,Europe,Northern Europe,"",150,154,""
|
|
104
|
+
India,IN,IND,356,ISO 3166-2:IN,Asia,Southern Asia,"",142,034,""
|
|
105
|
+
Indonesia,ID,IDN,360,ISO 3166-2:ID,Asia,South-eastern Asia,"",142,035,""
|
|
106
|
+
Iran (Islamic Republic of),IR,IRN,364,ISO 3166-2:IR,Asia,Southern Asia,"",142,034,""
|
|
107
|
+
Iraq,IQ,IRQ,368,ISO 3166-2:IQ,Asia,Western Asia,"",142,145,""
|
|
108
|
+
Ireland,IE,IRL,372,ISO 3166-2:IE,Europe,Northern Europe,"",150,154,""
|
|
109
|
+
Isle of Man,IM,IMN,833,ISO 3166-2:IM,Europe,Northern Europe,"",150,154,""
|
|
110
|
+
Israel,IL,ISR,376,ISO 3166-2:IL,Asia,Western Asia,"",142,145,""
|
|
111
|
+
Italy,IT,ITA,380,ISO 3166-2:IT,Europe,Southern Europe,"",150,039,""
|
|
112
|
+
Jamaica,JM,JAM,388,ISO 3166-2:JM,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
|
113
|
+
Japan,JP,JPN,392,ISO 3166-2:JP,Asia,Eastern Asia,"",142,030,""
|
|
114
|
+
Jersey,JE,JEY,832,ISO 3166-2:JE,Europe,Northern Europe,Channel Islands,150,154,830
|
|
115
|
+
Jordan,JO,JOR,400,ISO 3166-2:JO,Asia,Western Asia,"",142,145,""
|
|
116
|
+
Kazakhstan,KZ,KAZ,398,ISO 3166-2:KZ,Asia,Central Asia,"",142,143,""
|
|
117
|
+
Kenya,KE,KEN,404,ISO 3166-2:KE,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
|
|
118
|
+
Kiribati,KI,KIR,296,ISO 3166-2:KI,Oceania,Micronesia,"",009,057,""
|
|
119
|
+
Korea (Democratic People's Republic of),KP,PRK,408,ISO 3166-2:KP,Asia,Eastern Asia,"",142,030,""
|
|
120
|
+
Korea (Republic of),KR,KOR,410,ISO 3166-2:KR,Asia,Eastern Asia,"",142,030,""
|
|
121
|
+
Kuwait,KW,KWT,414,ISO 3166-2:KW,Asia,Western Asia,"",142,145,""
|
|
122
|
+
Kyrgyzstan,KG,KGZ,417,ISO 3166-2:KG,Asia,Central Asia,"",142,143,""
|
|
123
|
+
Lao People's Democratic Republic,LA,LAO,418,ISO 3166-2:LA,Asia,South-eastern Asia,"",142,035,""
|
|
124
|
+
Latvia,LV,LVA,428,ISO 3166-2:LV,Europe,Northern Europe,"",150,154,""
|
|
125
|
+
Lebanon,LB,LBN,422,ISO 3166-2:LB,Asia,Western Asia,"",142,145,""
|
|
126
|
+
Lesotho,LS,LSO,426,ISO 3166-2:LS,Africa,Sub-Saharan Africa,Southern Africa,002,202,018
|
|
127
|
+
Liberia,LR,LBR,430,ISO 3166-2:LR,Africa,Sub-Saharan Africa,Western Africa,002,202,011
|
|
128
|
+
Libya,LY,LBY,434,ISO 3166-2:LY,Africa,Northern Africa,"",002,015,""
|
|
129
|
+
Liechtenstein,LI,LIE,438,ISO 3166-2:LI,Europe,Western Europe,"",150,155,""
|
|
130
|
+
Lithuania,LT,LTU,440,ISO 3166-2:LT,Europe,Northern Europe,"",150,154,""
|
|
131
|
+
Luxembourg,LU,LUX,442,ISO 3166-2:LU,Europe,Western Europe,"",150,155,""
|
|
132
|
+
Macao,MO,MAC,446,ISO 3166-2:MO,Asia,Eastern Asia,"",142,030,""
|
|
133
|
+
Macedonia (the former Yugoslav Republic of),MK,MKD,807,ISO 3166-2:MK,Europe,Southern Europe,"",150,039,""
|
|
134
|
+
Madagascar,MG,MDG,450,ISO 3166-2:MG,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
|
|
135
|
+
Malawi,MW,MWI,454,ISO 3166-2:MW,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
|
|
136
|
+
Malaysia,MY,MYS,458,ISO 3166-2:MY,Asia,South-eastern Asia,"",142,035,""
|
|
137
|
+
Maldives,MV,MDV,462,ISO 3166-2:MV,Asia,Southern Asia,"",142,034,""
|
|
138
|
+
Mali,ML,MLI,466,ISO 3166-2:ML,Africa,Sub-Saharan Africa,Western Africa,002,202,011
|
|
139
|
+
Malta,MT,MLT,470,ISO 3166-2:MT,Europe,Southern Europe,"",150,039,""
|
|
140
|
+
Marshall Islands,MH,MHL,584,ISO 3166-2:MH,Oceania,Micronesia,"",009,057,""
|
|
141
|
+
Martinique,MQ,MTQ,474,ISO 3166-2:MQ,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
|
142
|
+
Mauritania,MR,MRT,478,ISO 3166-2:MR,Africa,Sub-Saharan Africa,Western Africa,002,202,011
|
|
143
|
+
Mauritius,MU,MUS,480,ISO 3166-2:MU,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
|
|
144
|
+
Mayotte,YT,MYT,175,ISO 3166-2:YT,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
|
|
145
|
+
Mexico,MX,MEX,484,ISO 3166-2:MX,Americas,Latin America and the Caribbean,Central America,019,419,013
|
|
146
|
+
Micronesia (Federated States of),FM,FSM,583,ISO 3166-2:FM,Oceania,Micronesia,"",009,057,""
|
|
147
|
+
Moldova (Republic of),MD,MDA,498,ISO 3166-2:MD,Europe,Eastern Europe,"",150,151,""
|
|
148
|
+
Monaco,MC,MCO,492,ISO 3166-2:MC,Europe,Western Europe,"",150,155,""
|
|
149
|
+
Mongolia,MN,MNG,496,ISO 3166-2:MN,Asia,Eastern Asia,"",142,030,""
|
|
150
|
+
Montenegro,ME,MNE,499,ISO 3166-2:ME,Europe,Southern Europe,"",150,039,""
|
|
151
|
+
Montserrat,MS,MSR,500,ISO 3166-2:MS,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
|
152
|
+
Morocco,MA,MAR,504,ISO 3166-2:MA,Africa,Northern Africa,"",002,015,""
|
|
153
|
+
Mozambique,MZ,MOZ,508,ISO 3166-2:MZ,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
|
|
154
|
+
Myanmar,MM,MMR,104,ISO 3166-2:MM,Asia,South-eastern Asia,"",142,035,""
|
|
155
|
+
Namibia,NA,NAM,516,ISO 3166-2:NA,Africa,Sub-Saharan Africa,Southern Africa,002,202,018
|
|
156
|
+
Nauru,NR,NRU,520,ISO 3166-2:NR,Oceania,Micronesia,"",009,057,""
|
|
157
|
+
Nepal,NP,NPL,524,ISO 3166-2:NP,Asia,Southern Asia,"",142,034,""
|
|
158
|
+
Netherlands,NL,NLD,528,ISO 3166-2:NL,Europe,Western Europe,"",150,155,""
|
|
159
|
+
New Caledonia,NC,NCL,540,ISO 3166-2:NC,Oceania,Melanesia,"",009,054,""
|
|
160
|
+
New Zealand,NZ,NZL,554,ISO 3166-2:NZ,Oceania,Australia and New Zealand,"",009,053,""
|
|
161
|
+
Nicaragua,NI,NIC,558,ISO 3166-2:NI,Americas,Latin America and the Caribbean,Central America,019,419,013
|
|
162
|
+
Niger,NE,NER,562,ISO 3166-2:NE,Africa,Sub-Saharan Africa,Western Africa,002,202,011
|
|
163
|
+
Nigeria,NG,NGA,566,ISO 3166-2:NG,Africa,Sub-Saharan Africa,Western Africa,002,202,011
|
|
164
|
+
Niue,NU,NIU,570,ISO 3166-2:NU,Oceania,Polynesia,"",009,061,""
|
|
165
|
+
Norfolk Island,NF,NFK,574,ISO 3166-2:NF,Oceania,Australia and New Zealand,"",009,053,""
|
|
166
|
+
Northern Mariana Islands,MP,MNP,580,ISO 3166-2:MP,Oceania,Micronesia,"",009,057,""
|
|
167
|
+
Norway,NO,NOR,578,ISO 3166-2:NO,Europe,Northern Europe,"",150,154,""
|
|
168
|
+
Oman,OM,OMN,512,ISO 3166-2:OM,Asia,Western Asia,"",142,145,""
|
|
169
|
+
Pakistan,PK,PAK,586,ISO 3166-2:PK,Asia,Southern Asia,"",142,034,""
|
|
170
|
+
Palau,PW,PLW,585,ISO 3166-2:PW,Oceania,Micronesia,"",009,057,""
|
|
171
|
+
"Palestine, State of",PS,PSE,275,ISO 3166-2:PS,Asia,Western Asia,"",142,145,""
|
|
172
|
+
Panama,PA,PAN,591,ISO 3166-2:PA,Americas,Latin America and the Caribbean,Central America,019,419,013
|
|
173
|
+
Papua New Guinea,PG,PNG,598,ISO 3166-2:PG,Oceania,Melanesia,"",009,054,""
|
|
174
|
+
Paraguay,PY,PRY,600,ISO 3166-2:PY,Americas,Latin America and the Caribbean,South America,019,419,005
|
|
175
|
+
Peru,PE,PER,604,ISO 3166-2:PE,Americas,Latin America and the Caribbean,South America,019,419,005
|
|
176
|
+
Philippines,PH,PHL,608,ISO 3166-2:PH,Asia,South-eastern Asia,"",142,035,""
|
|
177
|
+
Pitcairn,PN,PCN,612,ISO 3166-2:PN,Oceania,Polynesia,"",009,061,""
|
|
178
|
+
Poland,PL,POL,616,ISO 3166-2:PL,Europe,Eastern Europe,"",150,151,""
|
|
179
|
+
Portugal,PT,PRT,620,ISO 3166-2:PT,Europe,Southern Europe,"",150,039,""
|
|
180
|
+
Puerto Rico,PR,PRI,630,ISO 3166-2:PR,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
|
181
|
+
Qatar,QA,QAT,634,ISO 3166-2:QA,Asia,Western Asia,"",142,145,""
|
|
182
|
+
Réunion,RE,REU,638,ISO 3166-2:RE,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
|
|
183
|
+
Romania,RO,ROU,642,ISO 3166-2:RO,Europe,Eastern Europe,"",150,151,""
|
|
184
|
+
Russian Federation,RU,RUS,643,ISO 3166-2:RU,Europe,Eastern Europe,"",150,151,""
|
|
185
|
+
Rwanda,RW,RWA,646,ISO 3166-2:RW,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
|
|
186
|
+
Saint Barthélemy,BL,BLM,652,ISO 3166-2:BL,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
|
187
|
+
"Saint Helena, Ascension and Tristan da Cunha",SH,SHN,654,ISO 3166-2:SH,Africa,Sub-Saharan Africa,Western Africa,002,202,011
|
|
188
|
+
Saint Kitts and Nevis,KN,KNA,659,ISO 3166-2:KN,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
|
189
|
+
Saint Lucia,LC,LCA,662,ISO 3166-2:LC,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
|
190
|
+
Saint Martin (French part),MF,MAF,663,ISO 3166-2:MF,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
|
191
|
+
Saint Pierre and Miquelon,PM,SPM,666,ISO 3166-2:PM,Americas,Northern America,"",019,021,""
|
|
192
|
+
Saint Vincent and the Grenadines,VC,VCT,670,ISO 3166-2:VC,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
|
193
|
+
Samoa,WS,WSM,882,ISO 3166-2:WS,Oceania,Polynesia,"",009,061,""
|
|
194
|
+
San Marino,SM,SMR,674,ISO 3166-2:SM,Europe,Southern Europe,"",150,039,""
|
|
195
|
+
Sao Tome and Principe,ST,STP,678,ISO 3166-2:ST,Africa,Sub-Saharan Africa,Middle Africa,002,202,017
|
|
196
|
+
Saudi Arabia,SA,SAU,682,ISO 3166-2:SA,Asia,Western Asia,"",142,145,""
|
|
197
|
+
Senegal,SN,SEN,686,ISO 3166-2:SN,Africa,Sub-Saharan Africa,Western Africa,002,202,011
|
|
198
|
+
Serbia,RS,SRB,688,ISO 3166-2:RS,Europe,Southern Europe,"",150,039,""
|
|
199
|
+
Seychelles,SC,SYC,690,ISO 3166-2:SC,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
|
|
200
|
+
Sierra Leone,SL,SLE,694,ISO 3166-2:SL,Africa,Sub-Saharan Africa,Western Africa,002,202,011
|
|
201
|
+
Singapore,SG,SGP,702,ISO 3166-2:SG,Asia,South-eastern Asia,"",142,035,""
|
|
202
|
+
Sint Maarten (Dutch part),SX,SXM,534,ISO 3166-2:SX,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
|
203
|
+
Slovakia,SK,SVK,703,ISO 3166-2:SK,Europe,Eastern Europe,"",150,151,""
|
|
204
|
+
Slovenia,SI,SVN,705,ISO 3166-2:SI,Europe,Southern Europe,"",150,039,""
|
|
205
|
+
Solomon Islands,SB,SLB,090,ISO 3166-2:SB,Oceania,Melanesia,"",009,054,""
|
|
206
|
+
Somalia,SO,SOM,706,ISO 3166-2:SO,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
|
|
207
|
+
South Africa,ZA,ZAF,710,ISO 3166-2:ZA,Africa,Sub-Saharan Africa,Southern Africa,002,202,018
|
|
208
|
+
South Georgia and the South Sandwich Islands,GS,SGS,239,ISO 3166-2:GS,Americas,Latin America and the Caribbean,South America,019,419,005
|
|
209
|
+
South Sudan,SS,SSD,728,ISO 3166-2:SS,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
|
|
210
|
+
Spain,ES,ESP,724,ISO 3166-2:ES,Europe,Southern Europe,"",150,039,""
|
|
211
|
+
Sri Lanka,LK,LKA,144,ISO 3166-2:LK,Asia,Southern Asia,"",142,034,""
|
|
212
|
+
Sudan,SD,SDN,729,ISO 3166-2:SD,Africa,Northern Africa,"",002,015,""
|
|
213
|
+
Suriname,SR,SUR,740,ISO 3166-2:SR,Americas,Latin America and the Caribbean,South America,019,419,005
|
|
214
|
+
Svalbard and Jan Mayen,SJ,SJM,744,ISO 3166-2:SJ,Europe,Northern Europe,"",150,154,""
|
|
215
|
+
Swaziland,SZ,SWZ,748,ISO 3166-2:SZ,Africa,Sub-Saharan Africa,Southern Africa,002,202,018
|
|
216
|
+
Sweden,SE,SWE,752,ISO 3166-2:SE,Europe,Northern Europe,"",150,154,""
|
|
217
|
+
Switzerland,CH,CHE,756,ISO 3166-2:CH,Europe,Western Europe,"",150,155,""
|
|
218
|
+
Syrian Arab Republic,SY,SYR,760,ISO 3166-2:SY,Asia,Western Asia,"",142,145,""
|
|
219
|
+
"Taiwan, Province of China",TW,TWN,158,ISO 3166-2:TW,Asia,Eastern Asia,"",142,030,""
|
|
220
|
+
Tajikistan,TJ,TJK,762,ISO 3166-2:TJ,Asia,Central Asia,"",142,143,""
|
|
221
|
+
"Tanzania, United Republic of",TZ,TZA,834,ISO 3166-2:TZ,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
|
|
222
|
+
Thailand,TH,THA,764,ISO 3166-2:TH,Asia,South-eastern Asia,"",142,035,""
|
|
223
|
+
Timor-Leste,TL,TLS,626,ISO 3166-2:TL,Asia,South-eastern Asia,"",142,035,""
|
|
224
|
+
Togo,TG,TGO,768,ISO 3166-2:TG,Africa,Sub-Saharan Africa,Western Africa,002,202,011
|
|
225
|
+
Tokelau,TK,TKL,772,ISO 3166-2:TK,Oceania,Polynesia,"",009,061,""
|
|
226
|
+
Tonga,TO,TON,776,ISO 3166-2:TO,Oceania,Polynesia,"",009,061,""
|
|
227
|
+
Trinidad and Tobago,TT,TTO,780,ISO 3166-2:TT,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
|
228
|
+
Tunisia,TN,TUN,788,ISO 3166-2:TN,Africa,Northern Africa,"",002,015,""
|
|
229
|
+
Turkey,TR,TUR,792,ISO 3166-2:TR,Asia,Western Asia,"",142,145,""
|
|
230
|
+
Turkmenistan,TM,TKM,795,ISO 3166-2:TM,Asia,Central Asia,"",142,143,""
|
|
231
|
+
Turks and Caicos Islands,TC,TCA,796,ISO 3166-2:TC,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
|
232
|
+
Tuvalu,TV,TUV,798,ISO 3166-2:TV,Oceania,Polynesia,"",009,061,""
|
|
233
|
+
Uganda,UG,UGA,800,ISO 3166-2:UG,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
|
|
234
|
+
Ukraine,UA,UKR,804,ISO 3166-2:UA,Europe,Eastern Europe,"",150,151,""
|
|
235
|
+
United Arab Emirates,AE,ARE,784,ISO 3166-2:AE,Asia,Western Asia,"",142,145,""
|
|
236
|
+
United Kingdom of Great Britain and Northern Ireland,GB,GBR,826,ISO 3166-2:GB,Europe,Northern Europe,"",150,154,""
|
|
237
|
+
United States of America,US,USA,840,ISO 3166-2:US,Americas,Northern America,"",019,021,""
|
|
238
|
+
United States Minor Outlying Islands,UM,UMI,581,ISO 3166-2:UM,Oceania,Micronesia,"",009,057,""
|
|
239
|
+
Uruguay,UY,URY,858,ISO 3166-2:UY,Americas,Latin America and the Caribbean,South America,019,419,005
|
|
240
|
+
Uzbekistan,UZ,UZB,860,ISO 3166-2:UZ,Asia,Central Asia,"",142,143,""
|
|
241
|
+
Vanuatu,VU,VUT,548,ISO 3166-2:VU,Oceania,Melanesia,"",009,054,""
|
|
242
|
+
Venezuela (Bolivarian Republic of),VE,VEN,862,ISO 3166-2:VE,Americas,Latin America and the Caribbean,South America,019,419,005
|
|
243
|
+
Viet Nam,VN,VNM,704,ISO 3166-2:VN,Asia,South-eastern Asia,"",142,035,""
|
|
244
|
+
Virgin Islands (British),VG,VGB,092,ISO 3166-2:VG,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
|
245
|
+
Virgin Islands (U.S.),VI,VIR,850,ISO 3166-2:VI,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
|
246
|
+
Wallis and Futuna,WF,WLF,876,ISO 3166-2:WF,Oceania,Polynesia,"",009,061,""
|
|
247
|
+
Western Sahara,EH,ESH,732,ISO 3166-2:EH,Africa,Northern Africa,"",002,015,""
|
|
248
|
+
Yemen,YE,YEM,887,ISO 3166-2:YE,Asia,Western Asia,"",142,145,""
|
|
249
|
+
Zambia,ZM,ZMB,894,ISO 3166-2:ZM,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
|
|
250
|
+
Zimbabwe,ZW,ZWE,716,ISO 3166-2:ZW,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
|
|
3
|
+
This file is provided for convinience, to see what's happening
|
|
4
|
+
inside the compact version that is used with table().
|
|
5
|
+
|
|
6
|
+
SOME IDEAS FOR MODIFICATION:
|
|
7
|
+
|
|
8
|
+
1) black text on white background
|
|
9
|
+
2) white text on black
|
|
10
|
+
3) very dark grey text on light grey
|
|
11
|
+
4) very light text on dark grey
|
|
12
|
+
5) western color scheme (don't ask)
|
|
13
|
+
|
|
14
|
+
-->
|
|
15
|
+
|
|
16
|
+
<style type="text/css">
|
|
17
|
+
|
|
18
|
+
body{font-size:14px;
|
|
19
|
+
font-family:Verdana,Arial,sans-serif;
|
|
20
|
+
border-collapse:collapse;
|
|
21
|
+
border-width:0px;
|
|
22
|
+
border-spacing:0;
|
|
23
|
+
border:none;
|
|
24
|
+
color:white;}
|
|
25
|
+
|
|
26
|
+
td{font-weight:bold;
|
|
27
|
+
text-align:right;
|
|
28
|
+
padding:10px 5px;
|
|
29
|
+
overflow:hidden;
|
|
30
|
+
word-break:normal;}
|
|
31
|
+
|
|
32
|
+
th{font-weight:normal;
|
|
33
|
+
padding:10px 5px;
|
|
34
|
+
border-style:solid;
|
|
35
|
+
border-width:0px;
|
|
36
|
+
text-align:right;
|
|
37
|
+
vertical-align:top;
|
|
38
|
+
overflow:hidden;
|
|
39
|
+
word-break:normal;}
|
|
40
|
+
|
|
41
|
+
.hr2{height: 1px; background-color: #FFF;}
|
|
42
|
+
|
|
43
|
+
h5{font-family:Verdana;}
|
|
44
|
+
h4{font-family:Verdana;}
|
|
45
|
+
hr{height: 3px; width: 630px; left; background-color: #FFF;}
|
|
46
|
+
col{width:120px;}
|
|
47
|
+
|
|
48
|
+
</style>
|
|
49
|
+
|
|
50
|
+
<body bgcolor="black">
|
|
51
|
+
<table class="pr" style="undefined;table-layout: fixed; width: 500px; border-style: hidden; border-collapse: collapse;">
|
|
52
|
+
|
|
53
|
+
<colgroup>
|
|
54
|
+
<col style="width: 150px">
|
|
55
|
+
<col>
|
|
56
|
+
<col>
|
|
57
|
+
<col>
|
|
58
|
+
<col>
|
|
59
|
+
</colgroup>
|
|
60
|
+
|
|
61
|
+
<h5>" + str(table_title) + "</h5>
|
|
62
|
+
|
|
63
|
+
<h4><i>" + str(title) + "</i></h4>
|
|
64
|
+
|
|
65
|
+
<hr align="left">
|
|
66
|
+
|
|
67
|
+
<tr> <th></th>
|
|
68
|
+
<th>median</th>
|
|
69
|
+
<th>mean</th>
|
|
70
|
+
<th>std</th>
|
|
71
|
+
<th>total</th>
|
|
72
|
+
</tr>
|
|
73
|
+
<tr>
|
|
74
|
+
<td>" + data.index[0] + "</td>
|
|
75
|
+
<td>" + str(data['median'][0]) + "</td>
|
|
76
|
+
<td>" + str(data['mean'][0]) + "</td>
|
|
77
|
+
<td>" + str(data['std'][0]) + "</td>
|
|
78
|
+
<td>" + str(data['sum'][0]) + "</td>
|
|
79
|
+
</tr>
|
|
80
|
+
<tr>
|
|
81
|
+
<td>" + data.index[1] + "</td>
|
|
82
|
+
<td>" + str(data['median'][1]) + "</td>
|
|
83
|
+
<td>" + str(data['mean'][1]) + "</td>
|
|
84
|
+
<td>" + str(data['std'][1]) + "</td>
|
|
85
|
+
<td>" + str(data['sum'][1]) + "</td>
|
|
86
|
+
</tr>
|
|
87
|
+
<tr> <td>" + data.index[2] + "</td>
|
|
88
|
+
<td>" + str(data['median'][2]) + "</td>
|
|
89
|
+
<td>" + str(data['mean'][2]) + "</td>
|
|
90
|
+
<td>" + str(data['std'][2]) + "</td>
|
|
91
|
+
<td>" + str(data['sum'][2]) + "</td>
|
|
92
|
+
</tr>
|
|
93
|
+
</table>
|
|
94
|
+
|
|
95
|
+
<hr align="left">
|
|
File without changes
|
astetik/plots/animate.py
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import glob
|
|
2
|
+
import os
|
|
3
|
+
import numpy as np
|
|
4
|
+
# EXCEPTIONAL IMPORT #
|
|
5
|
+
|
|
6
|
+
import matplotlib.pyplot as plt
|
|
7
|
+
|
|
8
|
+
from IPython.display import clear_output
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class Animation():
|
|
12
|
+
|
|
13
|
+
'''ANIMATED CHARTS
|
|
14
|
+
|
|
15
|
+
Supports dataformat where x and y are compared against each other, and
|
|
16
|
+
label_col provides the title (e.g. year) for each frame in the animation.
|
|
17
|
+
|
|
18
|
+
y and x are used for the legend labels when relevant.
|
|
19
|
+
|
|
20
|
+
'''
|
|
21
|
+
|
|
22
|
+
def __init__(self, data, x, y, label_col, plot_type, filename='animation',
|
|
23
|
+
dpi=72, palette='default'):
|
|
24
|
+
|
|
25
|
+
self.plot_type = plot_type
|
|
26
|
+
self.data = data
|
|
27
|
+
self.x = x
|
|
28
|
+
self.y = y
|
|
29
|
+
self.label_col = label_col
|
|
30
|
+
self.palette = palette
|
|
31
|
+
self.filename = filename
|
|
32
|
+
self.frames = len(data)
|
|
33
|
+
self.dpi = dpi
|
|
34
|
+
|
|
35
|
+
# RUNTIME
|
|
36
|
+
self._ = self._create_plots()
|
|
37
|
+
self._ = self._create_gif()
|
|
38
|
+
|
|
39
|
+
def _create_plots(self):
|
|
40
|
+
|
|
41
|
+
for i in range(self.frames):
|
|
42
|
+
data = np.array([self.data[self.x][i], self.data[self.y][i]]).astype(int)
|
|
43
|
+
self.plot_type(data,
|
|
44
|
+
labels=[self.x, self.y],
|
|
45
|
+
palette=self.palette,
|
|
46
|
+
sub_title=self.data[self.label_col][i],
|
|
47
|
+
save=True,
|
|
48
|
+
dpi=self.dpi)
|
|
49
|
+
clear_output()
|
|
50
|
+
plt.show()
|
|
51
|
+
|
|
52
|
+
def _create_gif(self):
|
|
53
|
+
|
|
54
|
+
gif_name = self.filename
|
|
55
|
+
file_list = glob.glob('astetik_*.png')
|
|
56
|
+
list.sort(file_list, key=lambda x: int(x.split('_')[1].split('.png')[0]))
|
|
57
|
+
|
|
58
|
+
with open('image_list.txt', 'w') as file:
|
|
59
|
+
for item in file_list:
|
|
60
|
+
file.write("%s\n" % item)
|
|
61
|
+
|
|
62
|
+
os.system('convert @image_list.txt {}.gif'.format(gif_name)) # magick on windows
|
astetik/plots/bar.py
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import seaborn as sns
|
|
2
|
+
import pandas as pd
|
|
3
|
+
|
|
4
|
+
from ..style.template import _header, _footer
|
|
5
|
+
from ..utils.utils import _scaler
|
|
6
|
+
from ..utils.utils import factorplot_sizing
|
|
7
|
+
from ..style.titles import _titles
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def bar(data,
|
|
11
|
+
x=None,
|
|
12
|
+
y=None,
|
|
13
|
+
sort=None,
|
|
14
|
+
order=None,
|
|
15
|
+
multi_color=False,
|
|
16
|
+
group_by_y=True,
|
|
17
|
+
orient='h',
|
|
18
|
+
aspect=1,
|
|
19
|
+
size=5,
|
|
20
|
+
palette='default',
|
|
21
|
+
alpha=1,
|
|
22
|
+
style='astetik',
|
|
23
|
+
dpi=72,
|
|
24
|
+
title='',
|
|
25
|
+
sub_title='',
|
|
26
|
+
x_label='',
|
|
27
|
+
y_label='',
|
|
28
|
+
legend=True,
|
|
29
|
+
x_scale='linear',
|
|
30
|
+
y_scale='linear',
|
|
31
|
+
x_limit=None,
|
|
32
|
+
y_limit=None,
|
|
33
|
+
save=False):
|
|
34
|
+
|
|
35
|
+
'''BAR PLOT
|
|
36
|
+
|
|
37
|
+
A 1-dimensional bar graph for the case where there is a single
|
|
38
|
+
value per label. Accepts either dataframe or series. If series,
|
|
39
|
+
then labels will come from index.
|
|
40
|
+
|
|
41
|
+
Inputs: 1 (Series), 2(DataFrame)
|
|
42
|
+
|
|
43
|
+
1. USE
|
|
44
|
+
======
|
|
45
|
+
ast.bar(data=patients,
|
|
46
|
+
x='icu_days',
|
|
47
|
+
y='insurance')
|
|
48
|
+
|
|
49
|
+
2. PARAMETERS
|
|
50
|
+
=============
|
|
51
|
+
2.1 INPUT PARAMETERS
|
|
52
|
+
--------------------
|
|
53
|
+
data :: pandas dataframe
|
|
54
|
+
|
|
55
|
+
x :: x-axis data (single value per label)
|
|
56
|
+
|
|
57
|
+
y :: y-axis data (labels)
|
|
58
|
+
|
|
59
|
+
--------------------
|
|
60
|
+
2.2. PLOT PARAMETERS
|
|
61
|
+
--------------------
|
|
62
|
+
sort :: If True, values will be sorted ascending, if False descending.
|
|
63
|
+
|
|
64
|
+
multi_color :: If True, label values will be used for hue.
|
|
65
|
+
|
|
66
|
+
group_by_y :: If set to False, duplicate values will not be merged.
|
|
67
|
+
|
|
68
|
+
----------------------
|
|
69
|
+
2.3. COMMON PARAMETERS
|
|
70
|
+
----------------------
|
|
71
|
+
palette :: One of the astetik palettes:
|
|
72
|
+
'default'
|
|
73
|
+
'colorblind'
|
|
74
|
+
'blue_to_red'
|
|
75
|
+
'blue_to_green'
|
|
76
|
+
'red_to_green'
|
|
77
|
+
'green_to_red'
|
|
78
|
+
'violet_to_blue'
|
|
79
|
+
'brown_to_green'
|
|
80
|
+
'green_to_marine'
|
|
81
|
+
|
|
82
|
+
Or use any cmap, seaborn or matplotlib
|
|
83
|
+
color or palette code, or hex value.
|
|
84
|
+
|
|
85
|
+
style :: Use one of the three core styles:
|
|
86
|
+
'astetik' # white
|
|
87
|
+
'538' # grey
|
|
88
|
+
'solarized' # sepia
|
|
89
|
+
|
|
90
|
+
Or alternatively use any matplotlib or seaborn
|
|
91
|
+
style definition.
|
|
92
|
+
|
|
93
|
+
dpi :: the resolution of the plot (int value)
|
|
94
|
+
|
|
95
|
+
title :: the title of the plot (string value)
|
|
96
|
+
|
|
97
|
+
sub_title :: a secondary title to be shown below the title
|
|
98
|
+
|
|
99
|
+
x_label :: string value for x-axis label
|
|
100
|
+
|
|
101
|
+
y_label :: string value for y-axis label
|
|
102
|
+
|
|
103
|
+
x_scale :: 'linear' or 'log' or 'symlog'
|
|
104
|
+
|
|
105
|
+
y_scale :: 'linear' or 'log' or 'symlog'
|
|
106
|
+
|
|
107
|
+
x_limit :: int or list with two ints
|
|
108
|
+
|
|
109
|
+
y_limit :: int or list with two ints
|
|
110
|
+
|
|
111
|
+
outliers :: Remove outliers using either 'zscore' or 'iqr'
|
|
112
|
+
'''
|
|
113
|
+
# convert series to dataframe
|
|
114
|
+
if x == None and y == None:
|
|
115
|
+
data = data.copy(deep=True)
|
|
116
|
+
data = pd.DataFrame(data)
|
|
117
|
+
data.reset_index(inplace=True)
|
|
118
|
+
data.columns = ['x', 'y']
|
|
119
|
+
x = 'y'
|
|
120
|
+
y = 'x'
|
|
121
|
+
|
|
122
|
+
#size, aspect = factorplot_sizing(data[x])
|
|
123
|
+
|
|
124
|
+
# merge duplicate items
|
|
125
|
+
if group_by_y == True:
|
|
126
|
+
data = data.groupby(y).sum().reset_index()
|
|
127
|
+
data.columns = [y, x]
|
|
128
|
+
|
|
129
|
+
if sort is not None:
|
|
130
|
+
order = data[x].sort_values(ascending=sort)
|
|
131
|
+
|
|
132
|
+
if multi_color == True:
|
|
133
|
+
n_colors = len(data[x].unique())
|
|
134
|
+
else:
|
|
135
|
+
n_colors = 1
|
|
136
|
+
|
|
137
|
+
# HEADER STARTS >>>
|
|
138
|
+
palette = _header(palette,
|
|
139
|
+
style,
|
|
140
|
+
n_colors=n_colors,
|
|
141
|
+
dpi=dpi,
|
|
142
|
+
fig_height=None,
|
|
143
|
+
fig_width=None)
|
|
144
|
+
# <<< HEADER ENDS
|
|
145
|
+
p = sns.catplot(data=data,
|
|
146
|
+
x=x,
|
|
147
|
+
y=y,
|
|
148
|
+
palette=palette,
|
|
149
|
+
orient=orient,
|
|
150
|
+
aspect=aspect,
|
|
151
|
+
height=size,
|
|
152
|
+
alpha=alpha,
|
|
153
|
+
order=order,
|
|
154
|
+
kind='bar')
|
|
155
|
+
|
|
156
|
+
# SCALING AND LIMITS STARTS >>>
|
|
157
|
+
if x_scale != 'linear' or y_scale != 'linear':
|
|
158
|
+
_scaler(p, x_scale, y_scale)
|
|
159
|
+
|
|
160
|
+
# FOOTER STARTS >>>
|
|
161
|
+
_titles(title, sub_title=sub_title)
|
|
162
|
+
_footer(p, x_label, y_label, save=save)
|
|
163
|
+
|
|
164
|
+
if data[x].min() < 0:
|
|
165
|
+
sns.despine(left=True)
|