Python: how to compute min, max, median, 1st and 3rd quartiles from a dict of lists?
<p>Let's say I have a dict of lists like this:</p>

<p><code>mydict={10:[],20:[],30:[],40:[],50:[1],60:[],70:[1],80:[7, 2, 7, 2, 2, 7, 2],90:[5, 2, 2, 6, 2, 3, 1, 2, 1, 2],...}</code></p>

<p>I want to compute: min, max, median, 1st and 3rd quartiles for each list in the dict. I tried <code>min</code> and <code>max</code> first, like this:</p>

<p><code>mins_mydict={k:min(v) for k,v in mydict.items()}</code></p>

<p><code>maxes_mydict={k:max(v) for k,v in mydict.items()}</code></p>

<p>but I get this error: <code>ValueError: min() arg is an empty sequence</code>. Same for <code>max</code>. Is it because some of my lists are empty?</p>

<p>How can I create an exception that checks if <code>len(list)=0</code>?</p>