Skip to Main Content
Hands-On Data Analysis with NumPy and pandas
book

Hands-On Data Analysis with NumPy and pandas

by Curtis Miller
June 2018
Beginner to intermediate content levelBeginner to intermediate
168 pages
3h 40m
English
Packt Publishing
Content preview from Hands-On Data Analysis with NumPy and pandas

Special numeric values

In addition to dtype objects, NumPy introduces special numeric values: nan and inf. These can arise in mathematical computations. Not A Number (nan). It indicates that a value that should be numeric is, in fact, not defined mathematically. For example, 0/0 yields nan. Sometimes, nan is also used to signify missing information; for example, pandas uses this. inf indicates a quantity that is arbitrarily large, so in practice, it means larger than any number the computer can conceive of. -inf is also defined and it means arbitrarily small. This could occur if a numeric operation blows up, that is, grows rapidly without bounds.

Nothing is ever equal to nan; it makes no sense for something undefined to be equal to something ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On Data Analysis with Pandas

Hands-On Data Analysis with Pandas

Stefanie Molin
Python: End-to-end Data Analysis

Python: End-to-end Data Analysis

Phuong Vothihong, Martin Czygan, Ivan Idris, Magnus Vilhelm Persson, Luiz Felipe Martins
Python: Data Analytics and Visualization

Python: Data Analytics and Visualization

Phuong Vo.T.H, Martin Czygan, Ashish Kumar, Kirthi Raman

Publisher Resources

ISBN: 9781789530797Supplemental Content