projects
/
neurodebian.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
04b0231
)
Fix div by zero prob.
author
Michael Hanke
<michael.hanke@gmail.com>
Mon, 16 May 2011 16:13:24 +0000
(12:13 -0400)
committer
Michael Hanke
<michael.hanke@gmail.com>
Mon, 16 May 2011 16:13:24 +0000
(12:13 -0400)
survey/makestats
patch
|
blob
|
history
diff --git
a/survey/makestats
b/survey/makestats
index 7b229b1e900febb3ff03c36dff119250958db69f..09b0c9415b20fe6d7f39a554c2c836dc841cfa7d 100755
(executable)
--- a/
survey/makestats
+++ b/
survey/makestats
@@
-187,7
+187,10
@@
def mkpic_os_per_env(db, destdir):
stats[os_family_rev[os]] += counts[os]
total_count = np.sum(stats.values())
for osf in stats:
- stats[osf] = float(stats[osf]) / total_count
+ if not total_count:
+ stats[osf] = 0
+ else:
+ stats[osf] = float(stats[osf]) / total_count
env_stats[env] = stats
# make stacked barplot
pl.figure(figsize=(6.4, 4.8))