Skip to content

Commit 27d18c7

Browse files
simonjayhawkinsjreback
authored andcommitted
TST: isort tests/reshape (#24550)
1 parent 3ad0cfc commit 27d18c7

11 files changed

+69
-82
lines changed

pandas/tests/reshape/merge/test_join.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
# pylint: disable=E1103
22

33
from warnings import catch_warnings
4-
from numpy.random import randn
4+
55
import numpy as np
6+
from numpy.random import randn
67
import pytest
78

8-
import pandas as pd
9-
from pandas.compat import lrange
9+
from pandas._libs import join as libjoin
1010
import pandas.compat as compat
11-
from pandas.util.testing import assert_frame_equal
12-
from pandas import DataFrame, MultiIndex, Series, Index, merge, concat
11+
from pandas.compat import lrange
1312

14-
from pandas._libs import join as libjoin
13+
import pandas as pd
14+
from pandas import DataFrame, Index, MultiIndex, Series, concat, merge
15+
from pandas.tests.reshape.merge.test_merge import NGROUPS, N, get_test_data
1516
import pandas.util.testing as tm
16-
from pandas.tests.reshape.merge.test_merge import get_test_data, N, NGROUPS
17-
17+
from pandas.util.testing import assert_frame_equal
1818

1919
a_ = np.array
2020

pandas/tests/reshape/merge/test_merge.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
11
# pylint: disable=E1103
22

3-
import random
4-
import re
53
from collections import OrderedDict
64
from datetime import date, datetime
5+
import random
6+
import re
77

88
import numpy as np
9-
import pytest
109
from numpy import nan
10+
import pytest
1111

12-
import pandas as pd
13-
import pandas.util.testing as tm
14-
from pandas import (Categorical, CategoricalIndex, DataFrame, DatetimeIndex,
15-
Float64Index, Int64Index, MultiIndex, RangeIndex,
16-
Series, UInt64Index)
17-
from pandas.api.types import CategoricalDtype as CDT
1812
from pandas.compat import lrange
13+
1914
from pandas.core.dtypes.common import is_categorical_dtype, is_object_dtype
2015
from pandas.core.dtypes.dtypes import CategoricalDtype
16+
17+
import pandas as pd
18+
from pandas import (
19+
Categorical, CategoricalIndex, DataFrame, DatetimeIndex, Float64Index,
20+
Int64Index, MultiIndex, RangeIndex, Series, UInt64Index)
21+
from pandas.api.types import CategoricalDtype as CDT
2122
from pandas.core.reshape.concat import concat
2223
from pandas.core.reshape.merge import MergeError, merge
24+
import pandas.util.testing as tm
2325
from pandas.util.testing import assert_frame_equal, assert_series_equal
2426

2527
N = 50

pandas/tests/reshape/merge/test_merge_asof.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1+
import numpy as np
12
import pytest
2-
33
import pytz
4-
import numpy as np
4+
55
import pandas as pd
6-
from pandas import (merge_asof, read_csv,
7-
to_datetime, Timedelta)
6+
from pandas import Timedelta, merge_asof, read_csv, to_datetime
87
from pandas.core.reshape.merge import MergeError
98
from pandas.util.testing import assert_frame_equal
109

pandas/tests/reshape/merge/test_merge_ordered.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
from numpy import nan
12
import pytest
3+
24
import pandas as pd
35
from pandas import DataFrame, merge_ordered
46
from pandas.util.testing import assert_frame_equal
57

6-
from numpy import nan
7-
88

99
class TestMergeOrdered(object):
1010

pandas/tests/reshape/test_concat.py

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,26 @@
1-
from warnings import catch_warnings, simplefilter
2-
from itertools import combinations
31
from collections import deque
2+
import datetime as dt
3+
from datetime import datetime
44
from decimal import Decimal
5+
from itertools import combinations
6+
from warnings import catch_warnings, simplefilter
57

6-
import datetime as dt
78
import dateutil
89
import numpy as np
910
from numpy.random import randn
11+
import pytest
12+
13+
from pandas.compat import PY2, Iterable, StringIO, iteritems
1014

11-
from datetime import datetime
12-
from pandas.compat import Iterable, StringIO, iteritems, PY2
13-
import pandas as pd
14-
from pandas import (DataFrame, concat,
15-
read_csv, isna, Series, date_range,
16-
Index, Panel, MultiIndex, Timestamp,
17-
DatetimeIndex, Categorical)
1815
from pandas.core.dtypes.dtypes import CategoricalDtype
19-
from pandas.util import testing as tm
20-
from pandas.util.testing import (assert_frame_equal,
21-
makeCustomDataframe as mkdf)
22-
from pandas.tests.extension.decimal import to_decimal
2316

24-
import pytest
17+
import pandas as pd
18+
from pandas import (
19+
Categorical, DataFrame, DatetimeIndex, Index, MultiIndex, Panel, Series,
20+
Timestamp, concat, date_range, isna, read_csv)
21+
from pandas.tests.extension.decimal import to_decimal
22+
from pandas.util import testing as tm
23+
from pandas.util.testing import assert_frame_equal, makeCustomDataframe as mkdf
2524

2625

2726
@pytest.fixture(params=[True, False])

pandas/tests/reshape/test_melt.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
# -*- coding: utf-8 -*-
22
# pylint: disable-msg=W0612,E1101
33

4+
import numpy as np
5+
from numpy import nan
46
import pytest
57

6-
from pandas import DataFrame
7-
import pandas as pd
8-
9-
from numpy import nan
10-
import numpy as np
8+
from pandas.compat import range
119

12-
from pandas import melt, lreshape, wide_to_long
10+
import pandas as pd
11+
from pandas import DataFrame, lreshape, melt, wide_to_long
1312
import pandas.util.testing as tm
14-
from pandas.compat import range
1513

1614

1715
class TestMelt(object):

pandas/tests/reshape/test_pivot.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
# -*- coding: utf-8 -*-
22

3-
from datetime import datetime, date, timedelta
3+
from collections import OrderedDict
4+
from datetime import date, datetime, timedelta
45

6+
import numpy as np
57
import pytest
68

9+
from pandas.compat import product, range
710

8-
import numpy as np
9-
10-
from collections import OrderedDict
1111
import pandas as pd
12-
from pandas import (DataFrame, Series, Index, MultiIndex,
13-
Grouper, date_range, concat, Categorical)
14-
from pandas.core.reshape.pivot import pivot_table, crosstab
15-
from pandas.compat import range, product
16-
import pandas.util.testing as tm
12+
from pandas import (
13+
Categorical, DataFrame, Grouper, Index, MultiIndex, Series, concat,
14+
date_range)
1715
from pandas.api.types import CategoricalDtype as CDT
16+
from pandas.core.reshape.pivot import crosstab, pivot_table
17+
import pandas.util.testing as tm
1818

1919

2020
@pytest.fixture(params=[True, False])

pandas/tests/reshape/test_reshape.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
# -*- coding: utf-8 -*-
22
# pylint: disable-msg=W0612,E1101
33

4-
import pytest
54
from collections import OrderedDict
65

7-
from pandas import DataFrame, Series
8-
from pandas.core.dtypes.common import is_integer_dtype
9-
from pandas.core.sparse.api import SparseDtype, SparseArray
10-
import pandas as pd
11-
12-
from numpy import nan
136
import numpy as np
7+
from numpy import nan
8+
import pytest
149

15-
from pandas.util.testing import assert_frame_equal
10+
from pandas.compat import u
11+
12+
from pandas.core.dtypes.common import is_integer_dtype
1613

17-
from pandas import get_dummies, Categorical, Index
14+
import pandas as pd
15+
from pandas import Categorical, DataFrame, Index, Series, get_dummies
16+
from pandas.core.sparse.api import SparseArray, SparseDtype
1817
import pandas.util.testing as tm
19-
from pandas.compat import u
18+
from pandas.util.testing import assert_frame_equal
2019

2120

2221
class TestGetDummies(object):

pandas/tests/reshape/test_union_categoricals.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
import numpy as np
12
import pytest
23

3-
import numpy as np
4-
import pandas as pd
5-
from pandas import Categorical, Series, CategoricalIndex
64
from pandas.core.dtypes.concat import union_categoricals
5+
6+
import pandas as pd
7+
from pandas import Categorical, CategoricalIndex, Series
78
from pandas.util import testing as tm
89

910

pandas/tests/reshape/test_util.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import pytest
21
import numpy as np
3-
from pandas import date_range, Index
4-
import pandas.util.testing as tm
2+
import pytest
3+
4+
from pandas import Index, date_range
55
from pandas.core.reshape.util import cartesian_product
6+
import pandas.util.testing as tm
67

78

89
class TestCartesianProduct(object):

setup.cfg

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -182,18 +182,6 @@ skip=
182182
pandas/tests/plotting/common.py,
183183
pandas/tests/plotting/test_boxplot_method.py,
184184
pandas/tests/plotting/test_deprecated.py,
185-
pandas/tests/reshape/test_concat.py,
186-
pandas/tests/reshape/test_util.py,
187-
pandas/tests/reshape/test_reshape.py,
188-
pandas/tests/reshape/test_tile.py,
189-
pandas/tests/reshape/test_pivot.py,
190-
pandas/tests/reshape/test_melt.py,
191-
pandas/tests/reshape/test_union_categoricals.py,
192-
pandas/tests/reshape/merge/test_merge_index_as_string.py,
193-
pandas/tests/reshape/merge/test_merge.py,
194-
pandas/tests/reshape/merge/test_merge_asof.py,
195-
pandas/tests/reshape/merge/test_join.py,
196-
pandas/tests/reshape/merge/test_merge_ordered.py,
197185
pandas/tests/sparse/test_indexing.py,
198186
pandas/tests/extension/test_sparse.py,
199187
pandas/tests/extension/base/reduce.py,

0 commit comments

Comments
 (0)