1
1
"""
2
- Routines for filling missing data
2
+ Routines for filling missing data.
3
3
"""
4
4
from distutils .version import LooseVersion
5
5
import operator
@@ -116,7 +116,7 @@ def interpolate_1d(xvalues, yvalues, method='linear', limit=None,
116
116
xvalues and yvalues will each be 1-d arrays of the same length.
117
117
118
118
Bounds_error is currently hardcoded to False since non-scipy ones don't
119
- take it as an argumnet .
119
+ take it as an argument .
120
120
"""
121
121
# Treat the original, non-scipy methods first.
122
122
@@ -244,9 +244,9 @@ def interpolate_1d(xvalues, yvalues, method='linear', limit=None,
244
244
def _interpolate_scipy_wrapper (x , y , new_x , method , fill_value = None ,
245
245
bounds_error = False , order = None , ** kwargs ):
246
246
"""
247
- passed off to scipy.interpolate.interp1d. method is scipy's kind.
247
+ Passed off to scipy.interpolate.interp1d. method is scipy's kind.
248
248
Returns an array interpolated at new_x. Add any new methods to
249
- the list in _clean_interp_method
249
+ the list in _clean_interp_method.
250
250
"""
251
251
try :
252
252
from scipy import interpolate
@@ -314,7 +314,7 @@ def _interpolate_scipy_wrapper(x, y, new_x, method, fill_value=None,
314
314
315
315
def _from_derivatives (xi , yi , x , order = None , der = 0 , extrapolate = False ):
316
316
"""
317
- Convenience function for interpolate.BPoly.from_derivatives
317
+ Convenience function for interpolate.BPoly.from_derivatives.
318
318
319
319
Construct a piecewise polynomial in the Bernstein basis, compatible
320
320
with the specified values and derivatives at breakpoints.
@@ -325,7 +325,7 @@ def _from_derivatives(xi, yi, x, order=None, der=0, extrapolate=False):
325
325
sorted 1D array of x-coordinates
326
326
yi : array_like or list of array-likes
327
327
yi[i][j] is the j-th derivative known at xi[i]
328
- orders : None or int or array_like of ints. Default: None.
328
+ order : None or int or array_like of ints. Default: None.
329
329
Specifies the degree of local polynomials. If not None, some
330
330
derivatives are ignored.
331
331
der : int or list
@@ -344,8 +344,7 @@ def _from_derivatives(xi, yi, x, order=None, der=0, extrapolate=False):
344
344
Returns
345
345
-------
346
346
y : scalar or array_like
347
- The result, of length R or length M or M by R,
348
-
347
+ The result, of length R or length M or M by R.
349
348
"""
350
349
import scipy
351
350
from scipy import interpolate
@@ -418,8 +417,9 @@ def _akima_interpolate(xi, yi, x, der=0, axis=0):
418
417
419
418
def interpolate_2d (values , method = 'pad' , axis = 0 , limit = None , fill_value = None ,
420
419
dtype = None ):
421
- """ perform an actual interpolation of values, values will be make 2-d if
422
- needed fills inplace, returns the result
420
+ """
421
+ Perform an actual interpolation of values, values will be make 2-d if
422
+ needed fills inplace, returns the result.
423
423
"""
424
424
425
425
transf = (lambda x : x ) if axis == 0 else (lambda x : x .T )
@@ -533,13 +533,13 @@ def clean_reindex_fill_method(method):
533
533
534
534
def fill_zeros (result , x , y , name , fill ):
535
535
"""
536
- if this is a reversed op, then flip x,y
536
+ If this is a reversed op, then flip x,y
537
537
538
- if we have an integer value (or array in y)
538
+ If we have an integer value (or array in y)
539
539
and we have 0's, fill them with the fill,
540
- return the result
540
+ return the result.
541
541
542
- mask the nan's from x
542
+ Mask the nan's from x.
543
543
"""
544
544
if fill is None or is_float_dtype (result ):
545
545
return result
0 commit comments