Return nan instead of empty to prevent subscript assignment error