← Back
Editing: test_rank.cpython-311.pyc
� d�c , � � � d dl Zd dlmZmZ d dlmZmZ d dlZ G d� d� � Z G d� d� � Z g g dg f�g d g f�g d g f�g dg f�g dg f�d gddgf�d gd dgf�d gd dgf�d gddgf�d gddgf�g d�dg d�f�g d�d g d�f�g d�d g d�f�g d�dg d�f�g d�dg d�f�g d�dg d�f�g d�d g d�f�g d�d g d�f�g d�dg d�f�g d�dg d�f�g d�dg d�f�g d�d g d�f�g d�d g d�f�g d�dg d�f�g d�dg d�f�g d�dg d�f�g d�d g d�f�g d�d g d�f�g d�dg d �f�g d�dg d!�f�d"gd#z d ej dd$� � f�R Zd%� Z dS )&� N)�assert_equal�assert_array_equal)�rankdata� tiecorrectc �, � e Zd Zd� Zd� Zd� Zd� Zd� ZdS )�TestTieCorrectc � � t j g t j �� � }t |� � }t |d� � dS )z9An empty array requires no correction, should return 1.0.��dtype� �?N��np�array�float64r r ��self�ranks�cs �=/usr/lib/python3/dist-packages/scipy/stats/tests/test_rank.py� test_emptyzTestTieCorrect.test_empty s; � ����2�:�.�.�.���u�����Q������� c � � t j dgt j �� � }t |� � }t |d� � dS )z;A single element requires no correction, should return 1.0.r r Nr r s r �test_onezTestTieCorrect.test_one s= � ���#��b�j�1�1�1���u�����Q������r c �� � t j d� � }t |� � }t |d� � t j d� � }t |� � }t |d� � dS )z*Arrays with no ties require no correction.� @r � @N)r �aranger r r s r �test_no_correctionz!TestTieCorrect.test_no_correction s\ � �� �#�����u�����Q������ �#�����u�����Q������r c � � t j g d�� � }t |� � }d}|j }d|dz |z |dz |z z z }t ||� � t j g d�� � }t |� � }d}|j }d|dz |z |dz |z z z }t ||� � t j g d�� � }t |� � }d}|j }d|dz |z |dz |z z z }t ||� � t j g d�� � }t |� � }d}d}|j }d|dz |z |dz |z z |dz |z z z }t ||� � d S ) z8Check a few basic examples of the tie correction factor.)r � @r r r � )� �?r"