o
    _~#g
                     @   s:   d Z ddlZddlmZmZ ddlmZ G dd dZ	dS )z@
Tests for np.foo applied to DataFrame, not necessarily ufuncs.
    N)Categorical	DataFramec                   @   s,   e Zd Zdd Zdd Zdd Zdd Zd	S )
TestAsArrayc                 C   sR   t tddgtddgd}t|}tjddgddggdd}t|| d S )N      )ABobject)dtype)r   r   npasarrayarraytmassert_numpy_array_equal)selfdfresultexpected r   /var/www/static.ux5.de/https/Moving-Object-Detection-with-OpenCV/env/lib/python3.10/site-packages/pandas/tests/frame/test_npfuncs.pytest_asarray_homogeneous   s   
z$TestAsArray.test_asarray_homogeneousc                 C   s   t jdd t |}W d    n1 sw   Y  t|t|s$J |j|js-J |j|js6J t	||
t j d S )Nignore)all)r   errstatesqrt
isinstancetypeindexis_columnsr   assert_frame_equalapply)r   float_framer   r   r   r   test_np_sqrt   s   zTestAsArray.test_np_sqrtc                 C   s   t jdd}t|}d}tjt|dd t |}W d    n1 s'w   Y  tjt|d |jd d}W d    n1 sDw   Y  t	|| d S )Nr   )      z:The behavior of DataFrame.sum with axis=None is deprecatedF)matchcheck_stacklevel)r&   )axis)
r   randomdefault_rngstandard_normalr   r   assert_produces_warningFutureWarningsumassert_series_equal)r   arrr   msgresr   r   r   r   !test_sum_deprecated_axis_behavior   s   z-TestAsArray.test_sum_deprecated_axis_behaviorc                 C   s   t g dg dg}t dd |D }t g d}t|| t t|d ddg d	d
}t g d}t|| t dd |D }t g d}t|| d S )N)=w?r2d?B^)Ҫ?T2o灨$пc                 S   s   g | ]
}t |d dqS )r   r%   r   reshape.0batchr   r   r   
<listcomp>8   s    z-TestAsArray.test_np_ravel.<locals>.<listcomp>)r4   r5   r6   r7   r8   r9   r   r   r%   x1x2x3r   c                 S   s$   g | ]}t |d dg ddqS )r   r%   r@   rD   r:   r<   r   r   r   r?   J   s    )r   r   ravelr   r   r   r;   )r   r0   r   r   r   r   r   test_np_ravel/   s,   
"
zTestAsArray.test_np_ravelN)__name__
__module____qualname__r   r#   r3   rF   r   r   r   r   r      s
    	r   )
__doc__numpyr   pandasr   r   pandas._testing_testingr   r   r   r   r   r   <module>   s
    