Файловый менеджер - Редактировать - /home/digitalm/venv/lib/python3.7/site-packages/pandas/tests/indexes/multi/test_lexsort.py
Назад
from pandas import MultiIndex import pandas._testing as tm class TestIsLexsorted: def test_is_lexsorted(self): levels = [[0, 1], [0, 1, 2]] index = MultiIndex( levels=levels, codes=[[0, 0, 0, 1, 1, 1], [0, 1, 2, 0, 1, 2]] ) assert index._is_lexsorted() index = MultiIndex( levels=levels, codes=[[0, 0, 0, 1, 1, 1], [0, 1, 2, 0, 2, 1]] ) assert not index._is_lexsorted() index = MultiIndex( levels=levels, codes=[[0, 0, 1, 0, 1, 1], [0, 1, 0, 2, 2, 1]] ) assert not index._is_lexsorted() assert index._lexsort_depth == 0 def test_is_lexsorted_deprecation(self): # GH 32259 with tm.assert_produces_warning(): MultiIndex.from_arrays([["a", "b", "c"], ["d", "f", "e"]]).is_lexsorted() class TestLexsortDepth: def test_lexsort_depth(self): # Test that lexsort_depth return the correct sortorder # when it was given to the MultiIndex const. # GH#28518 levels = [[0, 1], [0, 1, 2]] index = MultiIndex( levels=levels, codes=[[0, 0, 0, 1, 1, 1], [0, 1, 2, 0, 1, 2]], sortorder=2 ) assert index._lexsort_depth == 2 index = MultiIndex( levels=levels, codes=[[0, 0, 0, 1, 1, 1], [0, 1, 2, 0, 2, 1]], sortorder=1 ) assert index._lexsort_depth == 1 index = MultiIndex( levels=levels, codes=[[0, 0, 1, 0, 1, 1], [0, 1, 0, 2, 2, 1]], sortorder=0 ) assert index._lexsort_depth == 0 def test_lexsort_depth_deprecation(self): # GH 32259 with tm.assert_produces_warning(): MultiIndex.from_arrays([["a", "b", "c"], ["d", "f", "e"]]).lexsort_depth
| ver. 1.4 |
Github
|
.
| PHP 8.3.23 | Генерация страницы: 0.05 |
proxy
|
phpinfo
|
Настройка