|
1 | 1 | import collections |
2 | | -from datetime import timedelta |
3 | 2 | import functools |
4 | 3 | import gc |
5 | 4 | import json |
6 | 5 | import operator |
7 | 6 | import pickle |
8 | 7 | import re |
| 8 | +import warnings |
| 9 | +import weakref |
| 10 | +from datetime import timedelta |
9 | 11 | from textwrap import dedent |
10 | 12 | from typing import ( |
11 | 13 | TYPE_CHECKING, |
|
23 | 25 | Type, |
24 | 26 | Union, |
25 | 27 | ) |
26 | | -import warnings |
27 | | -import weakref |
28 | 28 |
|
29 | 29 | import numpy as np |
30 | 30 |
|
| 31 | +import pandas as pd |
| 32 | +import pandas.core.algorithms as algos |
| 33 | +import pandas.core.common as com |
| 34 | +import pandas.core.indexing as indexing |
31 | 35 | from pandas._config import config |
32 | | - |
33 | 36 | from pandas._libs import lib |
34 | 37 | from pandas._libs.tslibs import Timestamp, to_offset |
35 | 38 | from pandas._typing import ( |
|
47 | 50 | from pandas.compat import set_function_name |
48 | 51 | from pandas.compat._optional import import_optional_dependency |
49 | 52 | from pandas.compat.numpy import function as nv |
50 | | -from pandas.errors import AbstractMethodError, InvalidIndexError |
51 | | -from pandas.util._decorators import ( |
52 | | - doc, |
53 | | - rewrite_axis_style_signature, Appender, |
54 | | -) |
55 | | -from pandas.util._validators import ( |
56 | | - validate_bool_kwarg, |
57 | | - validate_fillna_kwargs, |
58 | | - validate_percentile, |
59 | | -) |
60 | | - |
| 53 | +from pandas.core import missing, nanops |
| 54 | +from pandas.core.base import PandasObject, SelectionMixin |
| 55 | +from pandas.core.construction import create_series_with_explicit_dtype |
61 | 56 | from pandas.core.dtypes.common import ( |
62 | 57 | ensure_int64, |
63 | 58 | ensure_object, |
|
81 | 76 | from pandas.core.dtypes.generic import ABCDataFrame, ABCSeries |
82 | 77 | from pandas.core.dtypes.inference import is_hashable |
83 | 78 | from pandas.core.dtypes.missing import isna, notna |
84 | | - |
85 | | -import pandas as pd |
86 | | -from pandas.core import missing, nanops |
87 | | -import pandas.core.algorithms as algos |
88 | | -from pandas.core.base import PandasObject, SelectionMixin |
89 | | -import pandas.core.common as com |
90 | | -from pandas.core.construction import create_series_with_explicit_dtype |
91 | 79 | from pandas.core.indexes.api import Index, MultiIndex, RangeIndex, ensure_index |
92 | 80 | from pandas.core.indexes.datetimes import DatetimeIndex |
93 | 81 | from pandas.core.indexes.period import Period, PeriodIndex |
94 | | -import pandas.core.indexing as indexing |
95 | 82 | from pandas.core.internals import BlockManager |
96 | 83 | from pandas.core.missing import find_valid_index |
97 | 84 | from pandas.core.ops import _align_method_FRAME |
98 | | - |
| 85 | +from pandas.errors import AbstractMethodError, InvalidIndexError |
99 | 86 | from pandas.io.formats import format as fmt |
100 | 87 | from pandas.io.formats.format import DataFrameFormatter, format_percentiles |
101 | 88 | from pandas.io.formats.printing import pprint_thing |
102 | 89 | from pandas.tseries.offsets import Tick |
| 90 | +from pandas.util._decorators import ( |
| 91 | + doc, |
| 92 | + rewrite_axis_style_signature, |
| 93 | + Appender, |
| 94 | +) |
| 95 | +from pandas.util._validators import ( |
| 96 | + validate_bool_kwarg, |
| 97 | + validate_fillna_kwargs, |
| 98 | + validate_percentile, |
| 99 | +) |
103 | 100 |
|
104 | 101 | if TYPE_CHECKING: |
105 | 102 | from pandas.core.resample import Resampler |
@@ -10490,7 +10487,7 @@ def transform(self, func, *args, **kwargs): |
10490 | 10487 |
|
10491 | 10488 | Examples |
10492 | 10489 | -------- |
10493 | | - >>> df = pd.DataFrame({{'A': range(3), 'B': range(1, 4)}}) |
| 10490 | + >>> df = pd.DataFrame(dict(A=range(3), B=range(1, 4))) |
10494 | 10491 | >>> df |
10495 | 10492 | A B |
10496 | 10493 | 0 0 1 |
|
0 commit comments