o
    d{                     @   s   d dl Zd dlZd dlm  mZ d dlZd dlm	Z	m
Z
mZmZmZ d dlmZ ejg dddd Zejg dddd	 ZG d
d dZdS )    N)Index
MultiIndexSeries
date_rangeisna)linearindexvaluesnearestslinearzero	quadraticcubicbarycentrickrogh
polynomialsplinepiecewise_polynomialfrom_derivativespchipakimacubicspline)paramsc                 C   "   | j }|dv rddini }||fS )a	  Fixture that returns an (method name, required kwargs) pair.

    This fixture does not include method 'time' as a parameterization; that
    method requires a Series with a DatetimeIndex, and is generally tested
    separately from these non-temporal methods.
    r   r   order   paramrequestmethodkwargs r#   q/var/www/html/visualizacion-main/env/lib/python3.10/site-packages/pandas/tests/series/methods/test_interpolate.pynontemporal_method   s   r%   )r   r   r   r   r   r   r   r   r   r   r   r   r   r   c                 C   r   )zFixture that returns a (method name, required kwargs) pair to
    be tested for various Index types.

    This fixture does not include methods - 'time', 'index', 'nearest',
    'values' as a parameterization
    r   r   r   r   r   r#   r#   r$   interp_methods_ind2   s   r&   c                   @   s  e Zd Zejjdddd Zdd Zdd Ze	j
d	d
 Ze	j
dd Ze	j
dd Ze	j
dd Ze	j
dd Zejdi ejddde	j
dgdd Zdd Zdd Zejdi ejddde	j
dgdd Zd d! Zd"d# Ze	j
d$d% Ze	j
d&d' Zd(d) Zejd*d+d,gd-d. Zd/d0 Zejd1d2d3gd4d5 Zd6d7 Zd8d9 Zd:d; Z d<d= Z!d>d? Z"ejd@g dAdBdC Z#ejdDe$j%e$j%dEe$j%e$j%e$j%dFe$j%e$j%g	e$j%e$j%dGdGdGdGdHe$j%e$j%g	dIdJdKfe$j%e$j%dEe$j%e$j%e$j%dFe$j%e$j%g	e$j%e$j%dGdGe$j%e$j%dHe$j%e$j%g	dIdJddLfe$j%e$j%dEe$j%e$j%e$j%dFe$j%e$j%g	e$j%e$j%dGe$j%e$j%e$j%dHdHdHg	dIdMdKfe$j%e$j%dEe$j%e$j%e$j%dFe$j%e$j%g	e$j%e$j%dGe$j%e$j%e$j%dHdHe$j%g	dIdMddLfe$j%e$j%e$j%e$j%e$j%e$j%e$j%ge$j%e$j%e$j%e$j%e$j%e$j%e$j%gdIdMddLfe&dNe&dNdIdMddLffdOdP Z'ejdDe$j%e$j%dEe$j%e$j%e$j%dFe$j%e$j%g	e$j%e$j%dGdHdHdHdHe$j%e$j%g	dQdJdKfe$j%e$j%dEe$j%e$j%e$j%dFe$j%e$j%g	e$j%e$j%dGe$j%e$j%dHdHe$j%e$j%g	dQdJddLfe$j%e$j%dEe$j%e$j%e$j%dFe$j%e$j%g	dGdGdGe$j%e$j%e$j%dHe$j%e$j%g	dQdMdKfe$j%e$j%dEe$j%e$j%e$j%dFe$j%e$j%g	e$j%dGdGe$j%e$j%e$j%dHe$j%e$j%g	dQdMddLffdRdS Z(dTdU Z)dVdW Z*dXdY Z+e	j
dZd[ Z,ejd\d]ejd^e	j
dgd_d` Z-e	j
dadb Z.e	j
ejdcdddIgdedf Z/dgdh Z0didj Z1e	j
ejdcddkgdldm Z2e	j
ejdnd+dod,dpe$j%gdqdr Z3e	j
dsdt Z4e	j
dudv Z5e	j
dwdx Z6e	j
dydz Z7d{d| Z8d}d~ Z9dd Z:ejdg de;j<ddde;j=d,ddgdd Z>e	j
dd Z?ejdd^g dfd]g dfgdd Z@d2S )TestSeriesInterpolateDataz)EA.fillna does not handle 'linear' methodreasonc                 C   sR   t tddd}| }tj|d< |jd}| }|jd}t	|| d S )Nz
2012-01-01   )periods   D)
r   r   copypdNaTdt	to_periodinterpolatetmassert_series_equal)selforigserser_perres_perexpected_perr#   r#   r$   test_interpolate_period_valuesQ   s   
z8TestSeriesInterpolateData.test_interpolate_period_valuesc                 C   s   t tjt|td|j}| }tj|dd< |jdd}t	
|| t dd |jD |jdt}| }tj|dd< |jd	d}t	
|| d S )
Ndtyper*   
   r   r!   c                 S   s   g | ]}|  qS r#   )	toordinal).0dr#   r#   r$   
<listcomp>g   s    z>TestSeriesInterpolateData.test_interpolate.<locals>.<listcomp>r   time)r   nparangelenfloatr   r.   NaNr3   r4   r5   astype)r6   datetime_serieststs_copylinear_interpord_tsord_ts_copytime_interpr#   r#   r$   test_interpolate]   s   z*TestSeriesInterpolateData.test_interpolatec                 C   sV   t dddtjg}d}tjt|d |jdd W d    d S 1 s$w   Y  d S )Nr   r   r,   zGtime-weighted interpolation only works on Series.* with a DatetimeIndexmatchrF   r@   )r   rG   rK   pytestraises
ValueErrorr3   )r6   non_tsmsgr#   r#   r$   /test_interpolate_time_raises_for_non_timeseriesp   s
   "zITestSeriesInterpolateData.test_interpolate_time_raises_for_non_timeseriesc                 C   sh   t g d}t g dtg dd}|jtg dt}||jdddd	 }t	|| d S )
Nr?            	      &@g     &@g      '@g     '@      (@g     (@g      )@g     )@      *@	      ?      ?      ?      ?       @      @      @      @      @rE   rg   rh   ri   rk   rl   rm   r   r@   r      
r   r   r   unionrL   rJ   reindexr3   r4   r5   )r6   r8   expected	new_indexresultr#   r#   r$   test_interpolate_cubicsplinex   s   
z6TestSeriesInterpolateData.test_interpolate_cubicsplinec                 C   sT   t ttjjdd}|jtg dt	}|
|jdd}|dd  d S )Nd   )size)g     H@g     H@g     H@g      I@g     @I@g     `I@r   r@   1   3   )r   rG   sortrandomuniformr   rr   r   rL   rJ   rs   r3   )r6   r8   ru   interp_sr#   r#   r$   test_interpolate_pchip   s   
z0TestSeriesInterpolateData.test_interpolate_pchipc                 C   s   t g d}t g dtg dd}|jtg dt}||jdd}t	|dd	 | t g d
tg dd}|jtg dt}||jddd}t	|dd	 | d S )Nr]   ra   re   rE   ro   r   r@   r   rp   )	rb   rf   rf   rf   rc   rf   rf   rf   rd   )r!   derrq   r6   r8   rt   ru   r   r#   r#   r$   test_interpolate_akima   s&   

z0TestSeriesInterpolateData.test_interpolate_akimac                 C   h   t g d}t g dtg dd}|jtg dt}||jdd}t	|dd	 | d S )
Nr]   ra   re   rE   ro   r   r@   r   rp   rq   r   r#   r#   r$   %test_interpolate_piecewise_polynomial      
z?TestSeriesInterpolateData.test_interpolate_piecewise_polynomialc                 C   r   )
Nr]   ra   re   rE   ro   r   r@   r   rp   rq   r   r#   r#   r$   !test_interpolate_from_derivatives   r   z;TestSeriesInterpolateData.test_interpolate_from_derivativesr"   r   r   r!   r   )marksc                 C   sT   t tjtjg}t|jdi || t g td }t|jdi || d S )Nr=   r#   )r   rG   nanr4   r5   r3   object)r6   r"   sr#   r#   r$   test_interpolate_corners   s   
z2TestSeriesInterpolateData.test_interpolate_cornersc                 C   s   t tjttjdd}tjd|d d d< |jj	t
}|jdd}| }t|j}| }t t|| || |j| |j| d}t|| | |jdd}t|| t|| | d S )N   rE   r?   rp   r   r@   r	   )r   rG   r   r|   r}   randrandnr   r	   rL   rJ   r3   r.   r   interpr4   r5   )r6   r   valsrv   rt   badgoodother_resultr#   r#   r$   test_interpolate_index_values   s   
"z7TestSeriesInterpolateData.test_interpolate_index_valuesc                 C   s^   t ddtjtjtjdg}d}tjt|d |jdd W d    d S 1 s(w   Y  d S )Nr   rp   r^   zStime-weighted interpolation only works on Series or DataFrames with a DatetimeIndexrU   rF   r@   r   rG   r   rW   rX   rY   r3   r6   r   r[   r#   r#   r$   test_interpolate_non_ts   s   "z1TestSeriesInterpolateData.test_interpolate_non_tsc                 C   s>   t ddtjdg}|jdi |}t g d}t|| d S )Nr   r   rp           rf   rj   rn   r#   r   rG   r   r3   r4   r5   )r6   r"   r   rv   rt   r#   r#   r$   test_nan_interpolate   s   
z.TestSeriesInterpolateData.test_nan_interpolatec                 C   sF   t ddtjdgg dd}| }t g dg dd}t|| d S )Nr   r,      )r   rp   r*   	   rE   )rf   rj   rn         @r   r6   r   rv   rt   r#   r#   r$   test_nan_irregular_index
     z2TestSeriesInterpolateData.test_nan_irregular_indexc                 C   sF   t dddtjgtdd}| }t g dtdd}t|| d S )Nr   r   r,   abcdrE   )r   rf   rj   rj   )r   rG   r   listr3   r4   r5   r   r#   r#   r$   test_nan_str_index  r   z,TestSeriesInterpolateData.test_nan_str_indexc                 C   sJ   t ddtjdgg dd}|jdd}t g dg dd}t|| d S )	Nr   r      )r   r,   rp   r   rE   r   r@   )rf   r         "@g      0@r   )r6   sqrv   rt   r#   r#   r$   test_interp_quad  s   z*TestSeriesInterpolateData.test_interp_quadc                 C   sD  t ddtjdtjdg}t g d}|jdd}t|| |jddd	}t|| t g d
}|jdd}t||d |jddd	}t|| t g d
}|jdd}t||d |jddd	}t|| t g d}|jdd}t|| |jddd	}t|| t g d}|jdd}t|| d S )Nr   rp   r_      )rf   rn   g      @rc   g     2@      9@r   r@   infer)r!   downcast)r   rp   rp   r_   r_   r   r
   rJ   r   )r   rn   g:/KK@rc   gL82@r   r   )rf   rn   g333333@rc   g3333332@r   r   )r   rG   r   r3   r4   r5   rL   r6   r   rt   rv   r#   r#   r$   test_interp_scipy_basic  s0   z1TestSeriesInterpolateData.test_interp_scipy_basicc                 C   sN   t ddtjtjtjdg}t ddddtjdg}|jd	d
d}t|| d S )Nr   rp   r^   rf   rn         @      @rb   r   r,   r!   limitr   r   r#   r#   r$   test_interp_limitB  s   z+TestSeriesInterpolateData.test_interp_limitr   r   c                 C   sd   t ddtjdg}|\}}tjtdd |jd||d| W d    d S 1 s+w   Y  d S )Nr   r,   r   zLimit must be greater than 0rU   r   r!   r#   r   )r6   r%   r   r   r!   r"   r#   r#   r$   *test_interpolate_invalid_nonpositive_limitI  s
   "zDTestSeriesInterpolateData.test_interpolate_invalid_nonpositive_limitc                 C   sh   t ddtjdg}|\}}d}tjtdd |jd||d| W d    d S 1 s-w   Y  d S )	Nr   r,   r   rj   zLimit must be an integerrU   r   r#   r   )r6   r%   r   r!   r"   r   r#   r#   r$   $test_interpolate_invalid_float_limitQ  s   "z>TestSeriesInterpolateData.test_interpolate_invalid_float_limitinvalid_methodNnonexistent_methodc                 C   s   t ddtjdtjdg}d| d}tjt|d |j|d W d    n1 s*w   Y  tjt|d |j|d	d
 W d    d S 1 sIw   Y  d S )Nr   rp   r_   r   zmethod must be one of.* Got 'z	' insteadrU   r@   r   r   r   )r6   r   r   r[   r#   r#   r$   test_interp_invalid_methodY  s   "z4TestSeriesInterpolateData.test_interp_invalid_methodc                 C   s^   t ddtjdtjdg}d}tjt|d |jddd W d    d S 1 s(w   Y  d S )	Nr   rp   r_   r   z&Cannot pass both fill_value and methodrU   pad)
fill_valuer!   r   )r6   r8   r[   r#   r#   r$   $test_interp_invalid_method_and_valuef  s
   "z>TestSeriesInterpolateData.test_interp_invalid_method_and_valuec                 C   sl   t ddtjtjtjdg}t ddddtjdg}|jd	d
dd}t|| |jd	d
dd}t|| d S )Nr   rp   r^   rf   rn   r   r   rb   r   r,   forwardr!   r   limit_directionFORWARDr   r   r#   r#   r$   test_interp_limit_forwardn  s   z3TestSeriesInterpolateData.test_interp_limit_forwardc              	   C   s   t tjddtjtjtjdtjg}t g d}|jddd}t|| t tjdddd	d
ddg}|jddd}t|| t ddddd	d
dtjg}|jddd}t|| d S )Nrf   rn   rb   )rf   rf   rn   r   r   r   rb   rb   r   bothr!   r   r   r   r   r   backwardr   r   r#   r#   r$   test_interp_unlimitedz  s   "z/TestSeriesInterpolateData.test_interp_unlimitedc                 C   s   t ddtjtjtjdg}d}tjt|d |jdddd	 W d    n1 s)w   Y  tjt|d |jddd
 W d    d S 1 sHw   Y  d S )Nr   rp   r^   zVInvalid limit_direction: expecting one of \['forward', 'backward', 'both'\], got 'abc'rU   r   r,   abcr   r   r   r   r#   r#   r$   test_interp_limit_bad_direction  s   "z9TestSeriesInterpolateData.test_interp_limit_bad_directionc              
   C   s2  t tjtjdtjtjtjdtjtjg	}t tjtjdddddtjtjg	}|jdd	d
}t|| t tjtjddtjtjdtjtjg	}|jdd	dd}t|| t tjtjddtjddtjtjg	}|jdd	ddd}t|| t tjtjdtjtjtjdddg	}|jddd
}t|| t tjtjdtjtjtjddtjg	}|jdddd}t|| t tjddtjtjtjddtjg	}|jddddd}t|| t dddtjtjtjdtjtjg	}|jdddd}t|| d}tjt|d |jddd
 W d    d S 1 sw   Y  d S )Nrp      rn   r   r         @r   r   insider!   
limit_arear   r!   r   r   r   )r!   r   r   r   outsider   )r!   r   r   zEInvalid limit_area: expecting one of \['inside', 'outside'\], got abcrU   r   )	r   rG   r   r3   r4   r5   rW   rX   rY   )r6   r   rt   rv   r[   r#   r#   r$   test_interp_limit_area  sH   (" $$ $$$z0TestSeriesInterpolateData.test_interp_limit_areaz!method, limit_direction, expected))r   r   r   )ffillr   r   )backfillr   r   )bfillr   r   )r   r   r   )r   r   r   )r   r   r   )r   r   r   c                 C   s`   t g d}d| d| d}tjt|d |j||d W d    d S 1 s)w   Y  d S )Nr   r,   rp   z`limit_direction` must be 'z' for method ``rU   r   )r   rW   rX   rY   r3   )r6   r!   r   rt   r   r[   r#   r#   r$   "test_interp_limit_direction_raises  s
   "z<TestSeriesInterpolateData.test_interp_limit_direction_raiseszdata, expected_data, kwargsrp   r   rn   r   r   r   r   r   r   r*   c                 C   0   t |}t |}|jdi |}t|| d S Nr#   r   r3   r4   r5   r6   dataexpected_datar"   r   rt   rv   r#   r#   r$   test_interp_limit_area_with_pad  s   &z9TestSeriesInterpolateData.test_interp_limit_area_with_padr   c                 C   r   r   r   r   r#   r#   r$   $test_interp_limit_area_with_backfill  s   z>TestSeriesInterpolateData.test_interp_limit_area_with_backfillc                 C   s  t ddtjtjtjdg}t ddtjdddg}|jd	d
dd}t|| t dddtjddg}|jd	ddd}t|| t ddtjtjtjddtjtjdtjg}t g d}|jd	d
dd}t|| t dddtjdddddddg}|jd	ddd}t|| d S )Nr   rp   r^   rf   rn   r   r   rb   r   r,   r   r   r   r   r   r   r_   )rf   rn   r   r   r   r   r         $@rb   rc   rc   r   r   r   rc   r   r   r#   r#   r$   test_interp_limit_direction(  s    *z5TestSeriesInterpolateData.test_interp_limit_directionc                 C   sx   t tjtjdddtjg}t dddddtjg}|jddd	d
}t|| t g d}|jdddd
}t|| d S )Nr*   r   r   r   r   r   r   r,   r   r   )r   r   r   r   r   r   r   r   r   r#   r#   r$   test_interp_limit_to_endsA  s   z3TestSeriesInterpolateData.test_interp_limit_to_endsc                 C   s   t tjtjddtjtjg}t tjtjdddtjg}|jdddd}t|| t tjdddtjtjg}|jddd	d}t|| t tjddddtjg}|jddd
d}t|| d S )Nr*   r   r   r   r   r   r   r   r   r   r   r   r#   r#   r$   test_interp_limit_before_endsM  s   z7TestSeriesInterpolateData.test_interp_limit_before_endsc                 C   s>   t g d}|jddd}t|| | }t|| d S )Nr   r   r   r   r   )r6   r   rv   r#   r#   r$   test_interp_all_good]  s
   z.TestSeriesInterpolateData.test_interp_all_goodcheck_scipyFTc                 C   s   t g d}tddtjg|d}| }d|jd< | }t	|| d}|rIt
jt|d |jddd W d    d S 1 sBw   Y  d S d S )	N))r   a)r   b)r,   cr   r,   rE   z?Only `method=linear` interpolation is supported on MultiIndexesrU   r   r   )r   from_tuplesr   rG   r   r.   locr3   r4   r5   rW   rX   rY   )r6   r   idxr   rt   rv   r[   r#   r#   r$   test_interp_multiIndexg  s   
"z0TestSeriesInterpolateData.test_interp_multiIndexc                 C   s\   t dtjdgg dd}d}tjt|d |jdd W d    d S 1 s'w   Y  d S )	Nr   rp   )r   r,   r   rE   z8krogh interpolation requires that the index be monotonicrU   r   r@   r   r   r#   r#   r$   test_interp_nonmono_raisex  s
   "z3TestSeriesInterpolateData.test_interp_nonmono_raiser!   r
   c                 C   sT   t dtjdgtdd|dd}|j|d}t g dtdd|dd}t|| d S )Nr   rp   1/1/2000r+   tzrE   r@   )rf   rf   rn   )r   rG   r   r   r3   r4   r5   )r6   r!   tz_naive_fixturedfrv   rt   r#   r#   r$   test_interp_datetime64  s   z0TestSeriesInterpolateData.test_interp_datetime64c                 C   sP   t dddd}t|}tj|d< |jdd}t|}|d |d< t|| d S )	Nz
2015-04-05rp   z
US/Centralr   r   r   r@   r   )r   r   r/   r0   r3   r4   r5   )r6   dtir8   rv   rt   r#   r#   r$   #test_interp_pad_datetime64tz_values  s   
z=TestSeriesInterpolateData.test_interp_pad_datetime64tz_valuesc                 C   s,   t g d}|jdd}|}t|| d S )Nrf   rj   rn   r   )r   r   r   r#   r#   r$   test_interp_limit_no_nans  s   z3TestSeriesInterpolateData.test_interp_limit_no_nansr   c                 C   sV   t ddtjdg}d}tjt|d |j|d W d    d S 1 s$w   Y  d S )Nr   r   rp   z6You must specify the order of the spline or polynomialrU   r@   r   )r6   r!   r   r[   r#   r#   r$   test_no_order  s
   "z'TestSeriesInterpolateData.test_no_orderr   g      r   c                 C   sX   t ddtjdg}d}tjt|d |jd|d W d    d S 1 s%w   Y  d S )Nr   r   rp   z.order needs to be specified and greater than 0rU   r   r   r   )r6   r   r   r[   r#   r#   r$   %test_interpolate_spline_invalid_order  s
   "z?TestSeriesInterpolateData.test_interpolate_spline_invalid_orderc                 C   sD   t ddtjddtjdg}|jddd}t g d}t|| d S )	Nr   r,   r   r*   r   r   r   rf   rj   rn   r   r   r   r   r   r   r#   r#   r$   test_spline  s   z%TestSeriesInterpolateData.test_splinec                 C   sn   t ddddtjdtjg}|jdddd}t g d}t|| |jddd	d}t g d
}t|| d S )Nr   r,   rp   r      r   )r!   r   ext)rf   rj   rn   r   r   r   r   r   r   r   )r6   r   result3	expected3result1	expected1r#   r#   r$   test_spline_extrapolate  s   z1TestSeriesInterpolateData.test_spline_extrapolatec                 C   sH   t ddtjddtjdg}|jdddd	d
 |jdddd
 ks"J d S )Nr   r,   r   gffffff@r   r   rp   r   )r!   r   r   r*   r   )r   rG   r   r3   )r6   r   r#   r#   r$   test_spline_smooth  s
   
z,TestSeriesInterpolateData.test_spline_smoothc                 C   sX   t tdd dd}tj|tjddd< |jdd	d
}|jdd	d
}t|| d S )Nr?   r,   rJ   r=   r   r   rp   r   r   r   )	r   rG   rH   r   r}   randintr3   r4   r5   )r6   r   r  r  r#   r#   r$   test_spline_interpolation  s
   z3TestSeriesInterpolateData.test_spline_interpolationc                 C   s   t dtjdgtg dd}|jdd}t g dtg dd}t|| t dtjdgtg dd}|jdd}t g d	tg dd}t|| d S )
Nr   rp   r   rE   rF   r@   r   )r   r,   r   )rf   g(%?rn   )r   rG   r   r/   to_timedeltar3   r4   r5   )r6   r   rv   rt   r#   r#   r$   test_interp_timedelta64  s   z1TestSeriesInterpolateData.test_interp_timedelta64c                 C   sZ   t dddd}ttjt||d}tj|d d d< |jdd}| }t	|| d S )	Nr   z	1/20/2000r-   )freqrE   r,   r	   r@   )
r   r   rG   r}   r   rI   r   r3   r4   r5   )r6   rngrN   rv   expr#   r#   r$   %test_series_interpolate_method_values  s   z?TestSeriesInterpolateData.test_series_interpolate_method_valuesc                 C   s   t dddd}tg d|}||tjdd  }||jdd	}t ddd
d}tg d|}||tjdd  }||jdd	}t	|j
|j
 d S )Nz1/1/2012r   12D)r+   r	  )r   r_      $   r   )daysrF   r@   12H)hours)r   r   appendr/   
DateOffsetsort_valuesrs   r3   r4   assert_numpy_array_equalr	   )r6   r   rN   ru   r  rv   r#   r#   r$    test_series_interpolate_intraday  s   z:TestSeriesInterpolateData.test_series_interpolate_intradayind)r   r   r   rC   z
2019-01-01r   startr+   )r  endc           	      C   s   t jddtjdg|d}|\}}|dkrtd |dkr8|d jdi |}tg dd|d	}t	|| d S d
| d}tj
t|d |d jdd|i| W d    d S 1 s]w   Y  d S )Nr   r   rp   rE   r   scipyr   r   namer   z9Index column must be numeric or datetime type when using z_ method other than linear. Try setting a numeric or datetime index column before interpolating.rU   r!   r#   )r/   	DataFramerG   r   rW   importorskipr3   r   r4   r5   rX   rY   )	r6   r&   r  r   r!   r"   rv   rt   expected_errorr#   r#   r$   test_interp_non_timedelta_index  s   

"z9TestSeriesInterpolateData.test_interp_non_timedelta_indexc           	      C   s   t jddd}t jddtjdg|d}|\}}|dv r)|jtjj	| dd	 |d j
dd
|i|}tg dd|d}t|| dS )z
        Tests for non numerical index types  - object, period, timedelta
        Note that all methods except time, index, nearest and values
        are tested here.
        r   r   r  r   rp   rE   >   r   r   z2 interpolation is not supported for TimedeltaIndexr(   r!   r   r  Nr#   )r/   timedelta_ranger  rG   r   node
add_markerrW   markxfailr3   r   r4   r5   )	r6   r    r&   r  r   r!   r"   rv   rt   r#   r#   r$    test_interpolate_timedelta_index  s   z:TestSeriesInterpolateData.test_interpolate_timedelta_indexzascending, expected_values)r   r,   rp   r   r?   r?   r   rp   r,   r   c                 C   sN   t ddtjddgg dd}|j|djdd	}t ||td
}t|| d S )Nr?   r   r,   r   r)  )r   r   )	ascendingr   r@   )r   r   r>   )r   rG   r   
sort_indexr3   rJ   r4   r5   )r6   r*  expected_valuesrN   rv   rt   r#   r#   r$   test_interpolate_unsorted_index.  s   z9TestSeriesInterpolateData.test_interpolate_unsorted_index)A__name__
__module____qualname__rW   r&  r'  r<   rT   r\   tdskip_if_no_scipyrw   r   r   r   r   parametrizer   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rG   r   ranger   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r  r  r/   period_rangeinterval_ranger"  r(  r-  r#   r#   r#   r$   r'   P   s6   






		
	

$

/
"" 
"" 



#"" 
"" 


	








r'   )numpyrG   rW   pandas.util._test_decoratorsutil_test_decoratorsr1  pandasr/   r   r   r   r   r   pandas._testing_testingr4   fixturer%   r&   r'   r#   r#   r#   r$   <module>   s    

