def round_sigfigs(x, n=<NUM_LIT:2>):
iterable = is_iterable(x)<EOL>if not iterable: x = [x]<EOL>x = _n.array(x)<EOL>for i in range(len(x)):<EOL><INDENT>if not x[i] in [None, _n.inf, _n.nan]:<EOL><INDENT>sig_figs = -int(_n.floor(_n.log10(abs(x[i]))))+n-<NUM_LIT:1><EOL>x[i] = _n.round(x[i], sig_figs)<EOL><DEDENT><DEDENT>if iterable: return x<EOL>else:        return x[<NUM_LIT:0>]<EOL>
Rounds the number to the specified significant figures. x can also be 
a list or array of numbers (in these cases, a numpy array is returned).