Cách đây không lâu, chúng tôi thậm chí đã cải thiện tài liệu để đề xuất người dùng sử dụng
// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
25 thay vì // float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
26 hoặc // float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
27 khi họ muốn kiểm tra xem một số có phải là NaN hay khôngChúng ta có thể xem xét vấn đề này từ C và Python
Trong C, chúng ta có thể lấy bất kỳ NaN nào từ hàm
// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
28NaN trong C#include
#include
#include
#include
#include
int main[void] {
double f1 = nan["1"];
uint64_t f1n; memcpy[&f1n, &f1, sizeof f1];
printf["nan[\"1\"] = %f [%" PRIx64 "]\n", f1, f1n];
double f2 = nan["2"];
uint64_t f2n; memcpy[&f2n, &f2, sizeof f2];
printf["nan[\"2\"] = %f [%" PRIx64 "]\n", f2, f2n];
double f3 = -nan[""];
uint64_t f3n; memcpy[&f3n, &f3, sizeof f3];
printf["-nan[\"\"] = %f [%" PRIx64 "]\n", f3, f3n];
double f4 = nan[""];
uint64_t f4n; memcpy[&f4n, &f4, sizeof f4];
printf["nan[\"\"] = %f [%" PRIx64 "]\n", f4, f4n];
return 0;
}
/**
* Output:
* nan["1"] = nan [7ff8000000000001]
* nan["2"] = nan [7ff8000000000002]
* -nan[""] = -nan [fff8000000000000]
* nan[""] = nan [7ff8000000000000]
*/
Nhưng trong Python thì không có sự tự do như vậy, chúng ta chỉ có thể lấy NaN thông qua hàm
// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
29, // float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
30 hoặc một số thao tác đặc biệt [chẳng hạn như // float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
31]. Giá trị trả về của // float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
29 là một đối tượng Python, chúng ta nên tập trung vào triển khai cơ bản của nó. Tôi đặt một số mã ở đây để minh họa giá trị của NaN trong PythonNaN trong Python// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
Như chúng ta có thể thấy, giá trị thực của
// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
29 có thể thu được bằng macro // float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
2, một giá trị cố định. Vì vậy, việc tạo NaN thành một singleton trong CPython là có sẵnCó thể có chỗ nào chưa hoàn thiện mong bạn sửa lại.
Có 9007199254740990 NAN có thể có trong các float IEEE-754 64 bit
Nếu số float của bạn đến từ một nguồn dữ liệu bên ngoài hoặc một hàm được viết bằng C, Fortran, Java, Rust, v.v., thì bạn có thể nhận được bất kỳ một trong số 9e15 NAN đó. Sử dụng
// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
26 để kiểm tra NAN không bao giờ đúng. Ngay cả khi chúng tôi đã lưu vào bộ đệm float['nan'] để điều này luôn đúngmath.nan is float['nan']
vẫn sẽ sai khi kiểm tra NAN bằng cách sử dụng
// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
26CPython hiện tại thậm chí không có bộ đệm 0. 0, vậy lợi ích của việc lưu trữ NAN vào bộ nhớ đệm là gì, vốn có khả năng hiếm hơn nhiều? . ]
Trong mọi trường hợp, bộ nhớ đệm của int và float là một chi tiết triển khai. Bạn không bao giờ nên dựa vào ints hoặc float để được lưu vào bộ đệm. Làm điều đó có nghĩa là bạn không còn viết mã Python độc lập với nền tảng nữa mà buộc mã của bạn vào một phiên bản cụ thể của một trình thông dịch cụ thể trên một hệ điều hành cụ thể
NaN là viết tắt của Not A Number và là một trong những cách phổ biến để biểu thị giá trị còn thiếu trong dữ liệu. Nó là một giá trị dấu phẩy động đặc biệt và không thể chuyển đổi thành bất kỳ loại nào khác ngoài float.
Giá trị NaN là một trong những vấn đề chính trong Phân tích dữ liệu. Điều rất cần thiết là phải xử lý NaN để có được kết quả mong muốn
Kiểm tra giá trị NaN trong Pandas DataFrame
Các cách kiểm tra NaN trong Pandas DataFrame như sau.
- Kiểm tra NaN với isnull[]. giá trị. phương thức bất kỳ []
- Đếm NaN Sử dụng isnull[]. phương pháp tổng []
- Kiểm tra NaN Sử dụng isnull[]. giá trị. phương thức bất kỳ []
- Đếm NaN Sử dụng isnull[]. Tổng[]. phương pháp tổng []
Phương pháp 1. Sử dụng isnull[]. giá trị. phương thức bất kỳ []
Ví dụ.
Python3
// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
36// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
37 // float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
38// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
37 // float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
40
0 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool0
0 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool1
0 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool2
0 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool3
0 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool4_______45
0 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool6
0 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool7
0 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool6
0 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool9
0 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool6
// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
510 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool6
// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
53// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
54// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
55// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
56____154// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
580 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool6
// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
40// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
41
// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
42// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
430 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool1
// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
450 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool1
// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
470 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool3
// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
49
// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
50// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
510 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool1
// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
530 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool3
// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
55// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
56// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
57
// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
58// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
59____1360đầu ra.
// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
4Cũng có thể lấy các vị trí chính xác có giá trị NaN. Chúng ta có thể làm như vậy bằng cách loại bỏ. giá trị. any[] từ isnull[]. giá trị. không tí nào[].
Python3
_______153____43____1363
đầu ra.
0 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool
Phương pháp 2. Sử dụng isnull[]. phương pháp tổng []
Ví dụ.
Python3
// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
36// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
37 // float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
38// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
37 // float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
40
0 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool0
0 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool1
0 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool2
0 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool3
0 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool4_______45
0 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool6
0 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool7
0 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool6
0 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool9
0 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool6
// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
510 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool6
// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
53// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
54// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
55// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
56____154// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
580 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool6
// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
40// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
41
// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
42// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
430 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool1
// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
450 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool1
// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
470 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool3
// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
49
// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
379// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
4000 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool1
// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
530 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool3
// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
404// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
405// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
57
// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
407// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
408// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
590 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool00
0 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool01
0 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool02
0 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool03
0 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool04
đầu ra
// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
5Phương pháp 3. Sử dụng isnull[]. giá trị. phương thức bất kỳ []
Ví dụ.
Python3
// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
36// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
37 // float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
38// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
37 // float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
40
0 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool10
0 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool1
0 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool2
0 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool13
0 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool4
0 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool5
0 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool6______47
0 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool6
0 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool9
0 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool6
// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
510 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool6
// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
53// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
54// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
560 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool6
_______427____428____158____46
// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
400 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool32
_______433
0 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool34
0 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool35
0 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool36
0 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool6
0 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool38
0 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool6
0 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool40
// float['nan'] will call this function to get the value of float object.
double
_Py_parse_inf_or_nan[const char *p, char **endptr]
{
...
else if [case_insensitive_match[s, "nan"]] {
s += 3;
retval = negate ? -Py_NAN : Py_NAN;
}
...
return retval;
}
// Py_NAN: Value that evaluates to a quiet Not-a-Number [NaN].
#if !defined[Py_NAN]
# if _Py__has_builtin[__builtin_nan]
// Built-in implementation of the ISO C99 function nan[]: quiet NaN.
# define Py_NAN [__builtin_nan[""]]
#else
// Use C99 NAN constant: quiet Not-A-Number.
// NAN is a float, Py_NAN is a double: cast to double.
# define Py_NAN [[double]NAN]
# endif
#endif
540 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool42
0 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool6
0 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool44
0 False 1 False 2 False 3 False 4 False 5 True 6 False 7 True 8 False 9 False 10 True Name: Integers, dtype: bool6