Created
December 8, 2016 07:53
-
-
Save tpapp/0c5edb91afb1c72a9aef1c1376034453 to your computer and use it in GitHub Desktop.
countingVMZ
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
using AMDB | |
using DataStructures | |
using GZip | |
using UnicodePlots | |
# if we want to pass around code, extend it with your own machine name | |
# (gethostname# ()) and path | |
AMDB_path = get(Dict("tamas" => | |
"/home/tamas/research/AMDB/data/AMDB_subsample.jls.gz"), | |
gethostname(), | |
"/Users/emmamckeown/Documents/Thesis/AMDB_subsample.jls.gz") | |
records = GZip.open(deserialize, AMDB_path, "r") | |
long_samples = [data for (id,data) in records if length(data.AMP_spells) > 1000] | |
length(long_samples) # 6 | |
# let's look at the first one | |
f = long_samples[1].VMZ_spells | |
unique(spell.status for spell in f) # about 3 stauses | |
# let's count them | |
c1 = counter(Tuple{VMZ.Spell,VMZ.Einstellgrund}) # CHANGED HERE | |
for spell in f | |
push!(c1, (spell.status, spell.discontinuation)) | |
end | |
c1.map |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment