Файловый менеджер - Редактировать - /home/digitalm/venv/lib/python3.7/site-packages/pandas/tests/indexes/categorical/__pycache__/test_indexing.cpython-37.pyc
Назад
B �5�g�8 � @ s� d dl Zd dlZd dlmZ d dlZd dlmZmZm Z m Z d dlmZ G dd� d�ZG dd� d�ZG dd � d �ZG d d� d�ZG dd � d �ZdS )� N)�InvalidIndexError)�CategoricalIndex�Index� IntervalIndex� Timestampc @ s$ e Zd Zdd� Zdd� Zdd� ZdS )�TestTakec C s� t dddgdd�}|�t�dddg��}t dddgdd�}t�||� t�|j|j� |jt�dddg�dd �}t ddtjgdddgdd �}t�||� t�|j|j� |jt�dddg�ddd�}t dddgdd�}t�||� t�|j|j� t t d �t d�ddd�}|�t�dddg��}t t d�t d�ddd�}t�||� t�|j|j� |jt�dddg�dd �}t ddtjgt d�ddd�}t�||� t�|j|j� |jt�dddg�ddd�}t t d�t d�ddd�}t�||� t�|j|j� d}t jt|d�� |jt�dddg�dd � W d Q R X t jt|d�� |jt�dddg�dd � W d Q R X d}t jt |d�� |�t�ddg�� W d Q R X d S )N� � � �xxx)�namer ���T)� fill_value)� categoriesr F)� allow_fillr ZCBA�ABC)r �orderedr ZBCA�B�CzJWhen allow_fill=True and fill_value is not None, all indices must be >= -1)�match������z3index -5 is out of bounds for (axis 0 with )?size 3)r �take�np�array�tm�assert_index_equalZassert_categorical_equal�values�nan�list�pytest�raises� ValueError� IndexError)�self�idx�result�expected�msg� r) �d/home/digitalm-up/venv/lib/python3.7/site-packages/pandas/tests/indexes/categorical/test_indexing.py�test_take_fill_value sL $$zTestTake.test_take_fill_valuec C s� t jdddgdd�}t|�}|�t�dddg��}t jdddgdd�}t|�}t�||� |jt�dddg�d d �}t jdddgdd�}t �dddg�}t||d�}t�||� |jt�dddg�d d d�}t jdddgdd�}t|�}t�||� d}tj t |d�� |jt�dddg�d d � W d Q R X tj t |d�� |jt�dddg�d d � W d Q R X d}tj t|d�� |�t�ddg�� W d Q R X d S )Nz 2011-01-01z 2011-02-01z 2011-03-01r )r r r r T)r �NaT)r F)r r zJWhen allow_fill=True and fill_value is not None, all indices must be >= -1)r r r z3index -5 is out of bounds for (axis 0 with )?size 3)�pdZ DatetimeIndexr r r r r r r r! r"