ó
šxŠ\c           @   s”   d  d l  m Z m Z d  d l Z d  d l m Z d  d l m Z d  d l m	 Z	 m
 Z
 d  d l m Z e j j d ƒ d e f d	 „  ƒ  Yƒ Z d S(
   iÿÿÿÿ(   t   catch_warningst   simplefilterN(   t   lrange(   t   PerformanceWarning(   t	   DataFramet
   MultiIndex(   t   testings   ignore:\n.ix:DeprecationWarningt   TestMultiIndexIxc           B   s   e  Z d  „  Z d „  Z RS(   c         C   sÕ   | } d | j  d <| j  d d k s, t ‚ | j ƒ  } t d ƒ | _ d | j  d <| j  d d k sm t ‚ t d t ƒ : t d	 t ƒ | j ƒ  } t d ƒ | _ d | j	 d <Wd  QX| j  d d k sÑ t ‚ d  S(   Ni   t   bart   twot   Bi   i   i   t   recordt   ignore(   R   R	   (   (   R   R	   R
   (   R   R	   (   (   R   R	   R
   (   R   R	   (   (   R   R	   i   (   R   R	   (   (   R   R	   i   (   R   R	   (   (   R   R	   i   (   R   R	   (   (   R   R	   i   (
   t   loct   AssertionErrort   copyR   t   columnsR    t   TrueR   t   DeprecationWarningt   ix(   t   selft    multiindex_dataframe_random_datat   framet   df(    (    sG   lib/python2.7/site-packages/pandas/tests/indexing/multiindex/test_ix.pyt   test_frame_setitem_ix   s    c         C   s^  i i d d 6d d 6d d 6d d 6d	 d
 6d 6i d d 6d d 6d d 6d d 6d d
 6d 6i d d 6d d 6d d 6d d 6d d
 6d 6} t  | ƒ j d d d g ƒ } d } t j t ƒ # t j | j | | j d ƒ Wd  QX| j d t	 ƒ | j | } t
 j d g d d g d g d d d g ƒ} t  i d d d	 g d 6d | ƒ} t j | | ƒ d  S(   Ni¼  i    iX  i   iÞ   i   iM  i   i¼  i   t   amountg      @g      @t   coliÜ  iÛ  t   yeart   keyst   inplacet   namest   index(   g      @iÜ  (   R   t	   set_indext   tmt   assert_produces_warningR   t   assert_frame_equalR   t   iloct
   sort_indexR   R   t   from_arrays(   R   t   dataR   t   keyt   resR   t   expected(    (    sG   lib/python2.7/site-packages/pandas/tests/indexing/multiindex/test_ix.pyt   test_ix_general!   s    -*-$ "(   t   __name__t
   __module__R   R+   (    (    (    sG   lib/python2.7/site-packages/pandas/tests/indexing/multiindex/test_ix.pyR      s   	(   t   warningsR    R   t   pytestt   pandas.compatR   t   pandas.errorsR   t   pandasR   R   t   pandas.utilR   R!   t   markt   filterwarningst   objectR   (    (    (    sG   lib/python2.7/site-packages/pandas/tests/indexing/multiindex/test_ix.pyt   <module>   s   