A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pandas-dev/pandas/issues/11995 below:

pd.Timedelta cannot handle unicode on Python 2 · Issue #11995 · pandas-dev/pandas · GitHub

Skip to content Navigation Menu

Saved searches Use saved searches to filter your results more quickly

Sign up You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert Additional navigation options

BUG: pd.Timedelta cannot handle unicode on Python 2 #11995

Description

This is on master:

In [1]: import pandas as pd

In [2]: pd.__version__
Out[2]: '0.17.1+179.g44e4c96'

In [3]: pd.Timedelta('1H')
Out[3]: Timedelta('0 days 01:00:00')

In [4]: pd.Timedelta(u'1H')
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-4-9b0d9f7ba675> in <module>()
----> 1 pd.Timedelta(u'1H')

/Users/shoyer/dev/pandas/pandas/tslib.pyx in pandas.tslib.Timedelta.__new__ (pandas/tslib.c:39786)()
   2329             value = value.value
   2330         elif util.is_string_object(value):
-> 2331             value = np.timedelta64(parse_timedelta_string(value, False))
   2332         elif isinstance(value, timedelta):
   2333             value = convert_to_timedelta64(value,'ns',False)

/Users/shoyer/dev/pandas/pandas/tslib.pyx in pandas.tslib.parse_timedelta_string (pandas/tslib.c:46542)()
   2784         return NPY_NAT
   2785
-> 2786     for c in ts:
   2787
   2788         # skip whitespace / commas

TypeError: Expected str, got unicode```

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4