|
12 | 12 | import warnings
|
13 | 13 |
|
14 | 14 | import numpy as np
|
15 |
| -from pandas import ( |
16 |
| - Series, TimeSeries, DataFrame, Panel, Panel4D, Index, |
17 |
| - MultiIndex, Int64Index, Timestamp |
18 |
| -) |
| 15 | +from pandas import (Series, TimeSeries, DataFrame, Panel, Panel4D, Index, |
| 16 | + MultiIndex, Int64Index, Timestamp) |
19 | 17 | from pandas.sparse.api import SparseSeries, SparseDataFrame, SparsePanel
|
20 | 18 | from pandas.sparse.array import BlockIndex, IntIndex
|
21 | 19 | from pandas.tseries.api import PeriodIndex, DatetimeIndex
|
22 |
| -from pandas.core.common import adjoin, isnull, is_list_like |
23 |
| -from pandas.core.algorithms import match, unique, factorize |
| 20 | +from pandas.core.common import adjoin, is_list_like |
| 21 | +from pandas.core.algorithms import match, unique |
24 | 22 | from pandas.core.categorical import Categorical
|
25 |
| -from pandas.core.common import _asarray_tuplesafe, _try_sort |
| 23 | +from pandas.core.common import _asarray_tuplesafe |
26 | 24 | from pandas.core.internals import BlockManager, make_block
|
27 | 25 | from pandas.core.reshape import block2d_to_blocknd, factor_indexer
|
28 |
| -from pandas.core.index import Int64Index, _ensure_index |
| 26 | +from pandas.core.index import _ensure_index |
29 | 27 | import pandas.core.common as com
|
30 | 28 | from pandas.tools.merge import concat
|
31 | 29 | from pandas.util import py3compat
|
| 30 | +from pandas.io.common import PerformanceWarning |
32 | 31 |
|
33 | 32 | import pandas.lib as lib
|
34 | 33 | import pandas.algos as algos
|
|
42 | 41 | # PY3 encoding if we don't specify
|
43 | 42 | _default_encoding = 'UTF-8'
|
44 | 43 |
|
| 44 | + |
45 | 45 | def _ensure_decoded(s):
|
46 | 46 | """ if we have bytes, decode them to unicde """
|
47 | 47 | if isinstance(s, np.bytes_):
|
48 | 48 | s = s.decode('UTF-8')
|
49 | 49 | return s
|
| 50 | + |
| 51 | + |
50 | 52 | def _ensure_encoding(encoding):
|
51 | 53 | # set the encoding if we need
|
52 | 54 | if encoding is None:
|
53 | 55 | if py3compat.PY3:
|
54 | 56 | encoding = _default_encoding
|
55 | 57 | return encoding
|
56 | 58 |
|
57 |
| -class IncompatibilityWarning(Warning): pass |
| 59 | + |
| 60 | +class IncompatibilityWarning(Warning): |
| 61 | + pass |
| 62 | + |
| 63 | + |
58 | 64 | incompatibility_doc = """
|
59 |
| -where criteria is being ignored as this version [%s] is too old (or not-defined), |
60 |
| -read the file in and write it out to a new file to upgrade (with the copy_to method) |
| 65 | +where criteria is being ignored as this version [%s] is too old (or |
| 66 | +not-defined), read the file in and write it out to a new file to upgrade (with |
| 67 | +the copy_to method) |
61 | 68 | """
|
62 |
| -class AttributeConflictWarning(Warning): pass |
| 69 | + |
| 70 | + |
| 71 | +class AttributeConflictWarning(Warning): |
| 72 | + pass |
| 73 | + |
| 74 | + |
63 | 75 | attribute_conflict_doc = """
|
64 |
| -the [%s] attribute of the existing index is [%s] which conflicts with the new [%s], |
65 |
| -resetting the attribute to None |
| 76 | +the [%s] attribute of the existing index is [%s] which conflicts with the new |
| 77 | +[%s], resetting the attribute to None |
66 | 78 | """
|
67 |
| -class PerformanceWarning(Warning): pass |
| 79 | + |
| 80 | + |
68 | 81 | performance_doc = """
|
69 |
| -your performance may suffer as PyTables will pickle object types that it cannot map |
70 |
| -directly to c-types [inferred_type->%s,key->%s] [items->%s] |
| 82 | +your performance may suffer as PyTables will pickle object types that it cannot |
| 83 | +map directly to c-types [inferred_type->%s,key->%s] [items->%s] |
71 | 84 | """
|
72 | 85 |
|
73 | 86 | # map object types
|
|
0 commit comments