Bring Your Logic using Python
341 subscribers
109 photos
1 video
4 files
544 links
Logic building using Python : Materials, links, e-books and Code snippets
Download Telegram
Do you want to avoid problems with math.nan? Then use #numpy!

> np.sort([5., math.nan, 10., 0.])
array([ 0., 5., 10., nan])

> np.sort([math.nan, 1.])
array([ 1., nan])
> sorted([1., math.nan])
array([ 1., nan])

> np.max([3., math.nan, 1.])
nan
> np.nanmax([3., math.nan, 1.])
3.0