Skip to content

Commit 9bc7bac

Browse files
committed
COMPAT: pytables encoding reference invalid in python3.3
1 parent 00d730a commit 9bc7bac

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pandas/io/pytables.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
import pandas.core.common as com
3131
from pandas.tools.merge import concat
3232
from pandas import compat
33-
from pandas.compat import u_safe as u, PY3, range, lrange
33+
from pandas.compat import u_safe as u, PY3, range, lrange, string_types
3434
from pandas.io.common import PerformanceWarning
3535
from pandas.core.config import get_option
3636
from pandas.computation.pytables import Expr, maybe_expression
@@ -273,7 +273,7 @@ def to_hdf(path_or_buf, key, value, mode=None, complevel=None, complib=None,
273273
else:
274274
f = lambda store: store.put(key, value, **kwargs)
275275

276-
if isinstance(path_or_buf, compat.string_types):
276+
if isinstance(path_or_buf, string_types):
277277
with get_store(path_or_buf, mode=mode, complevel=complevel,
278278
complib=complib) as store:
279279
f(store)
@@ -316,7 +316,7 @@ def read_hdf(path_or_buf, key, **kwargs):
316316
f = lambda store, auto_close: store.select(
317317
key, auto_close=auto_close, **kwargs)
318318

319-
if isinstance(path_or_buf, compat.string_types):
319+
if isinstance(path_or_buf, string_types):
320320

321321
# can't auto open/close if we are using an iterator
322322
# so delegate to the iterator
@@ -732,7 +732,7 @@ def select_as_multiple(self, keys, where=None, selector=None, columns=None,
732732
where = _ensure_term(where)
733733
if isinstance(keys, (list, tuple)) and len(keys) == 1:
734734
keys = keys[0]
735-
if isinstance(keys, compat.string_types):
735+
if isinstance(keys, string_types):
736736
return self.select(key=keys, where=where, columns=columns,
737737
start=start, stop=stop, iterator=iterator,
738738
chunksize=chunksize, **kwargs)
@@ -4168,7 +4168,7 @@ def _unconvert_string_array(data, nan_rep=None, encoding=None):
41684168
encoding = _ensure_encoding(encoding)
41694169
if encoding is not None and len(data):
41704170
try:
4171-
data = data.astype(str).astype(object)
4171+
data = data.astype(string_types).astype(object)
41724172
except:
41734173
f = np.vectorize(lambda x: x.decode(encoding), otypes=[np.object])
41744174
data = f(data)

0 commit comments

Comments
 (0)