Completed
Push — master ( d08578...b66d8c )
by Philip
11s
created

nan_to_none()   A

Complexity

Conditions 2

Size

Total Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
c 1
b 0
f 0
dl 0
loc 2
rs 10
1
from math import isnan, nan
0 ignored issues
show
Coding Style introduced by
This module should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
Bug introduced by
The name nan does not seem to exist in module math.
Loading history...
2
3
from foil.records import replace_keys, rename_keys
0 ignored issues
show
Unused Code introduced by
Unused replace_keys imported from foil.records
Loading history...
Unused Code introduced by
Unused rename_keys imported from foil.records
Loading history...
4
5
6
def nan_to_none(value):
7
    return None if isnan(value) else value
8
9
10
def none_to_nan(value):
11
    return nan if value is None else value
12