bigframes.pandas.DataFrame.interpolate#

DataFrame.interpolate(method:str='linear')DataFrame[source]#

Fill NA (NULL in BigQuery) values using an interpolation method.

Examples:

>>>df=bpd.DataFrame({...'A':[1,2,3,None,None,6],...'B':[None,6,None,2,None,3],...},index=[0,0.1,0.3,0.7,0.9,1.0])>>>df.interpolate()       A     B0.0  1.0  <NA>0.1  2.0   6.00.3  3.0   4.00.7  4.0   2.00.9  5.0   2.51.0  6.0   3.0[6 rows x 2 columns]>>>df.interpolate(method="values")            A         B0.0       1.0      <NA>0.1       2.0       6.00.3       3.0  4.6666670.7  4.714286       2.00.9  5.571429  2.6666671.0       6.0       3.0[6 rows x 2 columns]
Parameters:

method (str,default 'linear') – Interpolation technique to use. Only ‘linear’ supported.‘linear’: Ignore the index and treat the values as equally spaced.This is the only method supported on MultiIndexes.‘index’, ‘values’: use the actual numerical values of the index.‘pad’: Fill in NaNs using existing values.‘nearest’, ‘zero’, ‘slinear’: Emulatesscipy.interpolate.interp1d

Returns:

Returns the same object type as the caller, interpolated atsome or allNaN values

Return type:

bigframes.pandas.DataFrame