after_merge
stringlengths
28
79.6k
before_merge
stringlengths
20
79.6k
url
stringlengths
38
71
full_traceback
stringlengths
43
922k
traceback_type
stringclasses
555 values
def _add_datelike(self, other): # adding a timedeltaindex to a datetimelike from pandas import Timestamp, DatetimeIndex if other is tslib.NaT: result = self._nat_new(box=False) else: other = Timestamp(other) i8 = self.asi8 result = i8 + other.value result = self....
def _add_datelike(self, other): # adding a timedeltaindex to a datetimelike from pandas import Timestamp, DatetimeIndex other = Timestamp(other) i8 = self.asi8 result = i8 + other.value result = self._maybe_mask_results(result, fill_value=tslib.iNaT) return DatetimeIndex(result, name=self.n...
https://github.com/pandas-dev/pandas/issues/11718
In [1]: import pandas as pd In [2]: pd.Timestamp(None, tz='utc') - pd.Timestamp('now', tz='utc') Traceback (most recent call last): File "<ipython-input-2-5e0738cec5fa>", line 1, in <module> pd.Timestamp(None, tz='utc') - pd.Timestamp('now', tz='utc') File "pandas\tslib.pyx", line 1099, in pandas.tslib._NaT.__sub__ ...
TypeError
def _sub_datelike(self, other): from pandas import DatetimeIndex if other is tslib.NaT: result = self._nat_new(box=False) else: raise TypeError("cannot subtract a datelike from a TimedeltaIndex") return DatetimeIndex(result, name=self.name, copy=False)
def _sub_datelike(self, other): raise TypeError("cannot subtract a datelike from a TimedeltaIndex")
https://github.com/pandas-dev/pandas/issues/11718
In [1]: import pandas as pd In [2]: pd.Timestamp(None, tz='utc') - pd.Timestamp('now', tz='utc') Traceback (most recent call last): File "<ipython-input-2-5e0738cec5fa>", line 1, in <module> pd.Timestamp(None, tz='utc') - pd.Timestamp('now', tz='utc') File "pandas\tslib.pyx", line 1099, in pandas.tslib._NaT.__sub__ ...
TypeError
def _get_time_bins(self, ax): if not isinstance(ax, DatetimeIndex): raise TypeError( "axis must be a DatetimeIndex, but got " "an instance of %r" % type(ax).__name__ ) if len(ax) == 0: binner = labels = DatetimeIndex(data=[], freq=self.freq, name=ax.name) ...
def _get_time_bins(self, ax): if not isinstance(ax, DatetimeIndex): raise TypeError( "axis must be a DatetimeIndex, but got " "an instance of %r" % type(ax).__name__ ) if len(ax) == 0: binner = labels = DatetimeIndex(data=[], freq=self.freq, name=ax.name) ...
https://github.com/pandas-dev/pandas/issues/12037
4.035752 4035751999 ValueError Traceback (most recent call last) <ipython-input-14-92e377227823> in <module>() 5 period_nanos=int(period_seconds*(10**9)) 6 print period_nanos ----> 7 res= dfi.value.resample(pd.tseries.offsets.Nano(period_nanos), how=[np.min, np.max,'mean']) 8...
ValueError
def _wrap_result(self, result, use_codes=True, name=None): # for category, we do the stuff on the categories, so blow it up # to the full series again # But for some operations, we have to do the stuff on the full values, # so make it possible to skip this step as the method already did this # befor...
def _wrap_result(self, result, use_codes=True, name=None): # for category, we do the stuff on the categories, so blow it up # to the full series again # But for some operations, we have to do the stuff on the full values, # so make it possible to skip this step as the method already did this # befor...
https://github.com/pandas-dev/pandas/issues/12180
s = pd.Series(['name', 'email|Name|address', 'address|email']) s.str.get_dummies(sep='|') --------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-5-1a39a6dcd56b> in <module>() ----> 1 s.str.get_dummies(sep='|'...
ValueError
def setup(self): self.rng = date_range(start="1/1/2000", periods=20000, freq="H") self.strings = [x.strftime("%Y-%m-%d %H:%M:%S") for x in self.rng] self.strings_nosep = [x.strftime("%Y%m%d %H:%M:%S") for x in self.rng] self.strings_tz_space = [ x.strftime("%Y-%m-%d %H:%M:%S") + " -0800" for x i...
def setup(self): self.N = 100000 self.rng = date_range(start="1/1/2000", periods=self.N, freq="T") if hasattr(Series, "convert"): Series.resample = Series.convert self.ts = Series(np.random.randn(self.N), index=self.rng) self.rng = date_range(start="1/1/2000", periods=20000, freq="H") se...
https://github.com/pandas-dev/pandas/issues/11871
import pandas pandas.__version__ u'0.17.1' pandas.to_datetime('2005-1-13', format='%Y-%m-%d') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/dpinte/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pandas/util/decorators.py", line 89, in wrapper return func(*args, **kw...
ValueError
def _to_datetime( arg, errors="raise", dayfirst=False, yearfirst=False, utc=None, box=True, format=None, exact=True, unit="ns", freq=None, infer_datetime_format=False, ): """ Same as to_datetime, but accept freq for DatetimeIndex internal construction """ ...
def _to_datetime( arg, errors="raise", dayfirst=False, yearfirst=False, utc=None, box=True, format=None, exact=True, unit="ns", freq=None, infer_datetime_format=False, ): """ Same as to_datetime, but accept freq for DatetimeIndex internal construction """ ...
https://github.com/pandas-dev/pandas/issues/11871
import pandas pandas.__version__ u'0.17.1' pandas.to_datetime('2005-1-13', format='%Y-%m-%d') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/dpinte/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pandas/util/decorators.py", line 89, in wrapper return func(*args, **kw...
ValueError
def _convert_listlike(arg, box, format, name=None): if isinstance(arg, (list, tuple)): arg = np.array(arg, dtype="O") # these are shortcutable if com.is_datetime64_ns_dtype(arg): if box and not isinstance(arg, DatetimeIndex): try: return DatetimeIndex(arg, tz="ut...
def _convert_listlike(arg, box, format, name=None): if isinstance(arg, (list, tuple)): arg = np.array(arg, dtype="O") # these are shortcutable if com.is_datetime64_ns_dtype(arg): if box and not isinstance(arg, DatetimeIndex): try: return DatetimeIndex(arg, tz="ut...
https://github.com/pandas-dev/pandas/issues/11871
import pandas pandas.__version__ u'0.17.1' pandas.to_datetime('2005-1-13', format='%Y-%m-%d') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/dpinte/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pandas/util/decorators.py", line 89, in wrapper return func(*args, **kw...
ValueError
def replace( self, to_replace, value, inplace=False, filter=None, regex=False, convert=True, mgr=None, ): """replace the to_replace value with value, possible to create new blocks here this is just a call to putmask. regex is not used here. It is used in ObjectBlocks. It is ...
def replace( self, to_replace, value, inplace=False, filter=None, regex=False, convert=True, mgr=None, ): """replace the to_replace value with value, possible to create new blocks here this is just a call to putmask. regex is not used here. It is used in ObjectBlocks. It is ...
https://github.com/pandas-dev/pandas/issues/11698
pandas.DataFrame([('-', pandas.to_datetime('20150101')), ('a', pandas.to_datetime('20150102')), ('b', pandas.to_datetime('20150103'))], columns=['a', 'b']).replace('-', numpy.nan) --------------------------------------------------------------------------- UnboundLocalError Traceback (most recent...
UnboundLocalError
def get_loc(self, key, method=None, tolerance=None): """ Get integer location for requested label Parameters ---------- key : label method : {None, 'pad'/'ffill', 'backfill'/'bfill', 'nearest'}, optional * default: exact matches only. * pad / ffill: find the PREVIOUS index value...
def get_loc(self, key, method=None, tolerance=None): """ Get integer location for requested label Parameters ---------- key : label method : {None, 'pad'/'ffill', 'backfill'/'bfill', 'nearest'}, optional * default: exact matches only. * pad / ffill: find the PREVIOUS index value...
https://github.com/pandas-dev/pandas/issues/11652
series length = 5 series length = 999999 series length = 1000000 Traceback (most recent call last): File "<stdin>", line 9, in <module> File "/home/nekobon/.env_exp/lib/python3.4/site-packages/pandas/core/indexing.py", line 114, in __setitem__ indexer = self._get_setitem_indexer(key) File "/home/nekobon/.env_exp/lib/py...
ValueError
def _get_setitem_indexer(self, key): if self.axis is not None: return self._convert_tuple(key, is_setter=True) axis = self.obj._get_axis(0) if isinstance(axis, MultiIndex): try: return axis.get_loc(key) except Exception: pass if isinstance(key, tuple) an...
def _get_setitem_indexer(self, key): if self.axis is not None: return self._convert_tuple(key, is_setter=True) axis = self.obj._get_axis(0) if isinstance(axis, MultiIndex): try: return axis.get_loc(key) except Exception: pass if isinstance(key, tuple) an...
https://github.com/pandas-dev/pandas/issues/11652
series length = 5 series length = 999999 series length = 1000000 Traceback (most recent call last): File "<stdin>", line 9, in <module> File "/home/nekobon/.env_exp/lib/python3.4/site-packages/pandas/core/indexing.py", line 114, in __setitem__ indexer = self._get_setitem_indexer(key) File "/home/nekobon/.env_exp/lib/py...
ValueError
def _adorn_subplots(self): """Common post process unrelated to data""" if len(self.axes) > 0: all_axes = self._get_subplots() nrows, ncols = self._get_axes_layout() _handle_shared_axes( axarr=all_axes, nplots=len(all_axes), naxes=nrows * ncols, ...
def _adorn_subplots(self): """Common post process unrelated to data""" if len(self.axes) > 0: all_axes = self._get_axes() nrows, ncols = self._get_axes_layout() _handle_shared_axes( axarr=all_axes, nplots=len(all_axes), naxes=nrows * ncols, ...
https://github.com/pandas-dev/pandas/issues/11556
fig, ax = plt.subplots() fig.add_axes([0.2, 0.2, 0.2, 0.2]) pd.Series(np.random.rand(100)).plot(ax=ax) --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-13-80531efe48c4> in <module>() 8 fig, ax = plt.sub...
AttributeError
def _get_axes_layout(self): axes = self._get_subplots() x_set = set() y_set = set() for ax in axes: # check axes coordinates to estimate layout points = ax.get_position().get_points() x_set.add(points[0][0]) y_set.add(points[0][1]) return (len(y_set), len(x_set))
def _get_axes_layout(self): axes = self._get_axes() x_set = set() y_set = set() for ax in axes: # check axes coordinates to estimate layout points = ax.get_position().get_points() x_set.add(points[0][0]) y_set.add(points[0][1]) return (len(y_set), len(x_set))
https://github.com/pandas-dev/pandas/issues/11556
fig, ax = plt.subplots() fig.add_axes([0.2, 0.2, 0.2, 0.2]) pd.Series(np.random.rand(100)).plot(ax=ax) --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-13-80531efe48c4> in <module>() 8 fig, ax = plt.sub...
AttributeError
def _join_monotonic(self, other, how="left", return_indexers=False): if self.equals(other): ret_index = other if how == "right" else self if return_indexers: return ret_index, None, None else: return ret_index sv = self.values ov = other._values if self....
def _join_monotonic(self, other, how="left", return_indexers=False): if self.equals(other): ret_index = other if how == "right" else self if return_indexers: return ret_index, None, None else: return ret_index sv = self.values ov = other._values if self....
https://github.com/pandas-dev/pandas/issues/11519
import pandas as pd import numpy as np df = pd.DataFrame({'A' : ['foo', 'bar', 'foo', 'bar', 'foo', 'bar', 'foo', 'foo'], 'B' : ['one', 'one', 'two', 'three', 'two', 'two', 'one', 'three'], 'C' : np.random.randn(8), 'D' : np.random.randn(8)}) s = pd.Series(np.repeat(np.arange(8),2), index=np.repeat(np.arange(8),2), n...
TypeError
def _add_margins(table, data, values, rows, cols, aggfunc): grand_margin = _compute_grand_margin(data, values, aggfunc) # categorical index or columns will fail below when 'All' is added # here we'll convert all categorical indices to object def convert_categorical(ind): _convert = lambda ind: ...
def _add_margins(table, data, values, rows, cols, aggfunc): grand_margin = _compute_grand_margin(data, values, aggfunc) if not values and isinstance(table, Series): # If there are no values and the table is a series, then there is only # one column in the data. Compute grand margin and return i...
https://github.com/pandas-dev/pandas/issues/10989
In [27]: data.y = data.y.astype('category') In [28]: data.z = data.z.astype('category') In [29]: data.pivot_table('x', 'y', 'z') Out[29]: z 0 1 2 y 0 24.0 25.0 24.5 1 73.5 74.5 74.0 In [32]: data.pivot_table('x', 'y', 'z', margins=True) --------------------------------------------------------------...
KeyError
def replace(self, to_replace, value, inplace=False, filter=None, regex=False): """replace the to_replace value with value, possible to create new blocks here this is just a call to putmask. regex is not used here. It is used in ObjectBlocks. It is here for API compatibility.""" values, to_replace =...
def replace(self, to_replace, value, inplace=False, filter=None, regex=False): """replace the to_replace value with value, possible to create new blocks here this is just a call to putmask. regex is not used here. It is used in ObjectBlocks. It is here for API compatibility.""" mask = com.mask_miss...
https://github.com/pandas-dev/pandas/issues/11326
df = extended_df Traceback (most recent call last): File "/Users/josh/anaconda/envs/Openfolio/lib/python2.7/site-packages/IPython/core/interactiveshell.py", line 3066, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "<ipython-input-14-3f216cf6821e>", line 1, in <module> df = extended_df NameError: na...
NameError
def _try_coerce_args(self, values, other): """localize and return i8 for the values""" values = values.tz_localize(None).asi8 if is_null_datelike_scalar(other): other = tslib.iNaT elif isinstance(other, self._holder): if other.tz != self.values.tz: raise ValueError("incompat...
def _try_coerce_args(self, values, other): """localize and return i8 for the values""" values = values.tz_localize(None).asi8 if is_null_datelike_scalar(other): other = tslib.iNaT elif isinstance(other, self._holder): if other.tz != self.values.tz: raise ValueError("incompat...
https://github.com/pandas-dev/pandas/issues/11326
df = extended_df Traceback (most recent call last): File "/Users/josh/anaconda/envs/Openfolio/lib/python2.7/site-packages/IPython/core/interactiveshell.py", line 3066, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "<ipython-input-14-3f216cf6821e>", line 1, in <module> df = extended_df NameError: na...
NameError
def size(self): """ Compute group sizes """ ids, _, ngroup = self.group_info ids = com._ensure_platform_int(ids) out = np.bincount(ids[ids != -1], minlength=ngroup) return Series(out, index=self.result_index, dtype="int64")
def size(self): """ Compute group sizes """ ids, _, ngroup = self.group_info out = np.bincount(ids[ids != -1], minlength=ngroup) return Series(out, index=self.result_index)
https://github.com/pandas-dev/pandas/issues/11189
In [1]: df = pd.DataFrame({"id":[1,2,3,4,5,6], "grade":['a', 'b', 'b', 'a', 'a', 'e']}) In [2]: df.groupby("grade").size() --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-3-d8e387418f9d> in <module>()...
TypeError
def group_info(self): ngroups = self.ngroups obs_group_ids = np.arange(ngroups) rep = np.diff(np.r_[0, self.bins]) rep = com._ensure_platform_int(rep) if ngroups == len(self.bins): comp_ids = np.repeat(np.arange(ngroups), rep) else: comp_ids = np.repeat(np.r_[-1, np.arange(ngrou...
def group_info(self): ngroups = self.ngroups obs_group_ids = np.arange(ngroups, dtype="int64") rep = np.diff(np.r_[0, self.bins]) if ngroups == len(self.bins): comp_ids = np.repeat(np.arange(ngroups, dtype="int64"), rep) else: comp_ids = np.repeat(np.r_[-1, np.arange(ngroups, dtype=...
https://github.com/pandas-dev/pandas/issues/11189
In [1]: df = pd.DataFrame({"id":[1,2,3,4,5,6], "grade":['a', 'b', 'b', 'a', 'a', 'e']}) In [2]: df.groupby("grade").size() --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-3-d8e387418f9d> in <module>()...
TypeError
def nunique(self, dropna=True): ids, _, _ = self.grouper.group_info val = self.obj.get_values() try: sorter = np.lexsort((val, ids)) except TypeError: # catches object dtypes assert val.dtype == object, "val.dtype must be object, got %s" % val.dtype val, _ = algos.factorize(val...
def nunique(self, dropna=True): ids, _, _ = self.grouper.group_info val = self.obj.get_values() try: sorter = np.lexsort((val, ids)) except TypeError: # catches object dtypes assert val.dtype == object, "val.dtype must be object, got %s" % val.dtype val, _ = algos.factorize(val...
https://github.com/pandas-dev/pandas/issues/11189
In [1]: df = pd.DataFrame({"id":[1,2,3,4,5,6], "grade":['a', 'b', 'b', 'a', 'a', 'e']}) In [2]: df.groupby("grade").size() --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-3-d8e387418f9d> in <module>()...
TypeError
def value_counts( self, normalize=False, sort=True, ascending=False, bins=None, dropna=True ): from functools import partial from pandas.tools.tile import cut from pandas.tools.merge import _get_join_indexers if bins is not None and not np.iterable(bins): # scalar bins cannot be done at top...
def value_counts( self, normalize=False, sort=True, ascending=False, bins=None, dropna=True ): from functools import partial from pandas.tools.tile import cut from pandas.tools.merge import _get_join_indexers if bins is not None and not np.iterable(bins): # scalar bins cannot be done at top...
https://github.com/pandas-dev/pandas/issues/11189
In [1]: df = pd.DataFrame({"id":[1,2,3,4,5,6], "grade":['a', 'b', 'b', 'a', 'a', 'e']}) In [2]: df.groupby("grade").size() --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-3-d8e387418f9d> in <module>()...
TypeError
def count(self): """Compute count of group, excluding missing values""" ids, _, ngroups = self.grouper.group_info val = self.obj.get_values() mask = (ids != -1) & ~isnull(val) ids = com._ensure_platform_int(ids) out = np.bincount(ids[mask], minlength=ngroups) if ngroups != 0 else [] return...
def count(self): """Compute count of group, excluding missing values""" ids, _, ngroups = self.grouper.group_info val = self.obj.get_values() mask = (ids != -1) & ~isnull(val) out = np.bincount(ids[mask], minlength=ngroups) if ngroups != 0 else [] return Series(out, index=self.grouper.result_i...
https://github.com/pandas-dev/pandas/issues/11189
In [1]: df = pd.DataFrame({"id":[1,2,3,4,5,6], "grade":['a', 'b', 'b', 'a', 'a', 'e']}) In [2]: df.groupby("grade").size() --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-3-d8e387418f9d> in <module>()...
TypeError
def count(self, level=None): """ Return number of non-NA/null observations in the Series Parameters ---------- level : int or level name, default None If the axis is a MultiIndex (hierarchical), count along a particular level, collapsing into a smaller Series Returns ------...
def count(self, level=None): """ Return number of non-NA/null observations in the Series Parameters ---------- level : int or level name, default None If the axis is a MultiIndex (hierarchical), count along a particular level, collapsing into a smaller Series Returns ------...
https://github.com/pandas-dev/pandas/issues/11189
In [1]: df = pd.DataFrame({"id":[1,2,3,4,5,6], "grade":['a', 'b', 'b', 'a', 'a', 'e']}) In [2]: df.groupby("grade").size() --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-3-d8e387418f9d> in <module>()...
TypeError
def convert_objects( self, datetime=False, numeric=False, timedelta=False, coerce=False, copy=True ): """ Attempt to infer better dtype for object columns Parameters ---------- datetime : boolean, default False If True, convert to date where possible. numeric : boolean, default Fals...
def convert_objects( self, datetime=False, numeric=False, timedelta=False, coerce=False, copy=True ): """ Attempt to infer better dtype for object columns Parameters ---------- datetime : boolean, default False If True, convert to date where possible. numeric : boolean, default Fals...
https://github.com/pandas-dev/pandas/issues/10601
In [1]: from datetime import datetime In [2]: s = pd.Series([datetime(2001,1,1,0,0), 'foo', 1.0, 1, ...: pd.Timestamp('20010104'), '20010105'], dtype='O') In [5]: s.convert_objects(convert_dates='coerce') c:\users\vdbosscj\scipy\pandas-joris\pandas\util\decorators.py:81: FutureWarning : the 'convert_da...
TypeError
def _new_DatetimeIndex(cls, d): """This is called upon unpickling, rather than the default which doesn't have arguments and breaks __new__""" # data are already in UTC # so need to localize tz = d.pop("tz", None) result = cls.__new__(cls, verify_integrity=False, **d) if tz is not None: ...
def _new_DatetimeIndex(cls, d): """This is called upon unpickling, rather than the default which doesn't have arguments and breaks __new__""" # data are already in UTC # so need to localize tz = d.pop("tz", None) result = cls.__new__(cls, **d) if tz is not None: result = result.tz_l...
https://github.com/pandas-dev/pandas/issues/11002
import pandas as pd df4 = pd.DataFrame(index=P.date_range('1750-1-1', '2050-1-1', freq='7D') pd.to_pickle(df4, '7d.test') pd.read_pickle('7d.test') In [84]: P.read_pickle('7d.test') --------------------------------------------------------------------------- ValueError Traceback (most re...
ValueError
def to_excel( self, excel_writer, sheet_name="Sheet1", na_rep="", float_format=None, columns=None, header=True, index=True, index_label=None, startrow=0, startcol=0, engine=None, merge_cells=True, encoding=None, inf_rep="inf", ): """ Write DataFrame to...
def to_excel( self, excel_writer, sheet_name="Sheet1", na_rep="", float_format=None, columns=None, header=True, index=True, index_label=None, startrow=0, startcol=0, engine=None, merge_cells=True, encoding=None, inf_rep="inf", ): """ Write DataFrame to...
https://github.com/pandas-dev/pandas/issues/6403
Traceback (most recent call last): File "/Users/myourshaw/lab/pypeline/python2/excel_example.py", line 10, in <module> xl_file.parse('Sheet1') File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pandas/io/excel.py", line 208, in parse **kwds) File "/usr/local/Cellar...
IndexError
def _parse_excel( self, sheetname=0, header=0, skiprows=None, skip_footer=0, index_col=None, has_index_names=None, parse_cols=None, parse_dates=False, date_parser=None, na_values=None, thousands=None, chunksize=None, convert_float=True, verbose=False, **kw...
def _parse_excel( self, sheetname=0, header=0, skiprows=None, skip_footer=0, index_col=None, has_index_names=None, parse_cols=None, parse_dates=False, date_parser=None, na_values=None, thousands=None, chunksize=None, convert_float=True, verbose=False, **kw...
https://github.com/pandas-dev/pandas/issues/6403
Traceback (most recent call last): File "/Users/myourshaw/lab/pypeline/python2/excel_example.py", line 10, in <module> xl_file.parse('Sheet1') File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pandas/io/excel.py", line 208, in parse **kwds) File "/usr/local/Cellar...
IndexError
def _conv_value(val): # Convert numpy types to Python types for the Excel writers. if com.is_integer(val): val = int(val) elif com.is_float(val): val = float(val) elif com.is_bool(val): val = bool(val) elif isinstance(val, Period): val = "%s" % val elif com.is_lis...
def _conv_value(val): # Convert numpy types to Python types for the Excel writers. if com.is_integer(val): val = int(val) elif com.is_float(val): val = float(val) elif com.is_bool(val): val = bool(val) elif isinstance(val, Period): val = "%s" % val return val
https://github.com/pandas-dev/pandas/issues/6403
Traceback (most recent call last): File "/Users/myourshaw/lab/pypeline/python2/excel_example.py", line 10, in <module> xl_file.parse('Sheet1') File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pandas/io/excel.py", line 208, in parse **kwds) File "/usr/local/Cellar...
IndexError
def __new__(cls, path, engine=None, **kwargs): # only switch class if generic(ExcelWriter) if issubclass(cls, ExcelWriter): if engine is None: if isinstance(path, string_types): ext = os.path.splitext(path)[-1][1:] else: ext = "xlsx" t...
def __new__(cls, path, engine=None, **kwargs): # only switch class if generic(ExcelWriter) if cls == ExcelWriter: if engine is None: ext = os.path.splitext(path)[-1][1:] try: engine = config.get_option("io.excel.%s.writer" % ext) except KeyError: ...
https://github.com/pandas-dev/pandas/issues/6403
Traceback (most recent call last): File "/Users/myourshaw/lab/pypeline/python2/excel_example.py", line 10, in <module> xl_file.parse('Sheet1') File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pandas/io/excel.py", line 208, in parse **kwds) File "/usr/local/Cellar...
IndexError
def __init__( self, path, engine=None, date_format=None, datetime_format=None, **engine_kwargs ): # validate that this engine can handle the extension if isinstance(path, string_types): ext = os.path.splitext(path)[-1] else: ext = "xls" if engine == "xlwt" else "xlsx" self.check_ext...
def __init__( self, path, engine=None, date_format=None, datetime_format=None, **engine_kwargs ): # validate that this engine can handle the extension ext = os.path.splitext(path)[-1] self.check_extension(ext) self.path = path self.sheets = {} self.cur_sheet = None if date_format is No...
https://github.com/pandas-dev/pandas/issues/6403
Traceback (most recent call last): File "/Users/myourshaw/lab/pypeline/python2/excel_example.py", line 10, in <module> xl_file.parse('Sheet1') File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pandas/io/excel.py", line 208, in parse **kwds) File "/usr/local/Cellar...
IndexError
def __init__(self, path, engine=None, encoding=None, **engine_kwargs): # Use the xlwt module as the Excel writer. import xlwt engine_kwargs["engine"] = engine super(_XlwtWriter, self).__init__(path, **engine_kwargs) if encoding is None: encoding = "ascii" self.book = xlwt.Workbook(enco...
def __init__(self, path, engine=None, encoding=None, **engine_kwargs): # Use the xlwt module as the Excel writer. import xlwt super(_XlwtWriter, self).__init__(path, **engine_kwargs) if encoding is None: encoding = "ascii" self.book = xlwt.Workbook(encoding=encoding) self.fm_datetime =...
https://github.com/pandas-dev/pandas/issues/6403
Traceback (most recent call last): File "/Users/myourshaw/lab/pypeline/python2/excel_example.py", line 10, in <module> xl_file.parse('Sheet1') File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pandas/io/excel.py", line 208, in parse **kwds) File "/usr/local/Cellar...
IndexError
def write_cells(self, cells, sheet_name=None, startrow=0, startcol=0): # Write the frame cells using xlsxwriter. sheet_name = self._get_sheet_name(sheet_name) if sheet_name in self.sheets: wks = self.sheets[sheet_name] else: wks = self.book.add_worksheet(sheet_name) self.sheets...
def write_cells(self, cells, sheet_name=None, startrow=0, startcol=0): # Write the frame cells using xlsxwriter. sheet_name = self._get_sheet_name(sheet_name) if sheet_name in self.sheets: wks = self.sheets[sheet_name] else: wks = self.book.add_worksheet(sheet_name) self.sheets...
https://github.com/pandas-dev/pandas/issues/6403
Traceback (most recent call last): File "/Users/myourshaw/lab/pypeline/python2/excel_example.py", line 10, in <module> xl_file.parse('Sheet1') File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pandas/io/excel.py", line 208, in parse **kwds) File "/usr/local/Cellar...
IndexError
def insert(self, loc, item): """ Make new Index inserting new item at location Parameters ---------- loc : int item : object if not either a Python datetime or a numpy integer-like, returned Index dtype will be object rather than datetime. Returns ------- new_index ...
def insert(self, loc, item): """ Make new Index inserting new item at location Parameters ---------- loc : int item : object if not either a Python datetime or a numpy integer-like, returned Index dtype will be object rather than datetime. Returns ------- new_index ...
https://github.com/pandas-dev/pandas/issues/10193
INSTALLED VERSIONS ------------------ commit: None python: 2.7.9.final.0 python-bits: 64 OS: Windows OS-release: 7 machine: AMD64 processor: Intel64 Family 6 Model 26 Stepping 5, GenuineIntel byteorder: little LC_ALL: None LANG: None pandas: 0.16.1-46-g0aceb38 nose: 1.3.6 Cython: 0.22 numpy: 1.9.2 scipy: 0.14.0 statsm...
IndexError
def _setitem_frame(self, key, value): # support boolean setting with DataFrame input, e.g. # df[df > df2] = 0 if key.values.size and not com.is_bool_dtype(key.values): raise TypeError("Must pass DataFrame with boolean values only") self._check_inplace_setting(value) self._check_setitem_copy...
def _setitem_frame(self, key, value): # support boolean setting with DataFrame input, e.g. # df[df > df2] = 0 if key.values.dtype != np.bool_: raise TypeError("Must pass DataFrame with boolean values only") self._check_inplace_setting(value) self._check_setitem_copy() self.where(-key, v...
https://github.com/pandas-dev/pandas/issues/10126
import pandas as pd df = pd.DataFrame() df[df>0] Traceback (most recent call last): File "<ipython-input-3-efe84c9ebabc>", line 1, in <module> df[df>0] File "C:\Python27\lib\site-packages\pandas\core\frame.py", line 1787, in __getitem__ return self._getitem_frame(key) File "C:\Python27\lib\site-packages\pandas\core\...
ValueError
def __init__( self, obj, path_or_buf=None, sep=",", na_rep="", float_format=None, cols=None, header=True, index=True, index_label=None, mode="w", nanRep=None, encoding=None, quoting=None, line_terminator="\n", chunksize=None, engine=None, tupleize_...
def __init__( self, obj, path_or_buf=None, sep=",", na_rep="", float_format=None, cols=None, header=True, index=True, index_label=None, mode="w", nanRep=None, encoding=None, quoting=None, line_terminator="\n", chunksize=None, engine=None, tupleize_...
https://github.com/pandas-dev/pandas/issues/8621
Python 3.4.2 (default, Oct 8 2014, 13:44:52) [GCC 4.9.1 20140903 (prerelease)] on linux Type "help", "copyright", "credits" or "license" for more information. import pandas as pd pd.show_versions() INSTALLED VERSIONS ------------------ commit: None python: 3.4.2.final.0 python-bits: 64 OS: Linux OS-release: 3.14.22-1...
ZeroDivisionError
def _adjust_dates_anchored(first, last, offset, closed="right", base=0): from pandas.tseries.tools import normalize_date # First and last offsets should be calculated from the start day to fix an # error cause by resampling across multiple days when a one day period is # not a multiple of the frequency...
def _adjust_dates_anchored(first, last, offset, closed="right", base=0): from pandas.tseries.tools import normalize_date start_day_nanos = Timestamp(normalize_date(first)).value last_day_nanos = Timestamp(normalize_date(last)).value base_nanos = (base % offset.n) * offset.nanos // offset.n start_d...
https://github.com/pandas-dev/pandas/issues/8683
--------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-20-71895ab1ef27> in <module>() ----> 1 R_inst = loaded_sorted.tail(200).head(20).resample('2200L', how='sum', label='right') /Users/josh/anaconda3/envs/...
ValueError
def get(self, key, default=None): """ Get item from object for given key (DataFrame column, Panel slice, etc.). Returns default value if not found Parameters ---------- key : object Returns ------- value : type of items contained in object """ try: return self[key] ...
def get(self, key, default=None): """ Get item from object for given key (DataFrame column, Panel slice, etc.). Returns default value if not found Parameters ---------- key : object Returns ------- value : type of items contained in object """ try: return self[key] ...
https://github.com/pandas-dev/pandas/issues/7725
s = pd.Series([1,2,3], index=["a","b","c"]) s a 1 b 2 c 3 dtype: int64 s.get("d", 0) 0 s.get(10, 0) Traceback (most recent call last): File "<ipython-input-18-26d73ac73179>", line 1, in <module> s.get(10, 0) File "/usr/local/lib/python2.7/dist-packages/pandas-0.14.0_421_g20dfc6b-py2.7-linux-x86_64.egg/pandas/c...
IndexError
def shift(self, periods, axis=0): """shift the block by periods, possibly upcast""" # convert integer to float if necessary. need to do a lot more than # that, handle boolean etc also new_values, fill_value = com._maybe_upcast(self.values) # make sure array sent to np.roll is c_contiguous f_orde...
def shift(self, periods, axis=0): """shift the block by periods, possibly upcast""" # convert integer to float if necessary. need to do a lot more than # that, handle boolean etc also new_values, fill_value = com._maybe_upcast(self.values) # make sure array sent to np.roll is c_contiguous f_orde...
https://github.com/pandas-dev/pandas/issues/8019
In [1]: from pandas import * In [2]: df = DataFrame(columns=['foo']) In [3]: df.shift(-1) --------------------------------------------------------------------------- ZeroDivisionError Traceback (most recent call last) <ipython-input-3-6aa009807b04> in <module>() ----> 1 df.shift(-1) /users/is...
ZeroDivisionError
def _write_data_nodates(self): data = self.datarows byteorder = self._byteorder TYPE_MAP = self.TYPE_MAP typlist = self.typlist for row in data: # row = row.squeeze().tolist() # needed for structured arrays for i, var in enumerate(row): typ = ord(typlist[i]) i...
def _write_data_nodates(self): data = self.datarows byteorder = self._byteorder TYPE_MAP = self.TYPE_MAP typlist = self.typlist for row in data: # row = row.squeeze().tolist() # needed for structured arrays for i, var in enumerate(row): typ = ord(typlist[i]) i...
https://github.com/pandas-dev/pandas/issues/7286
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Python27\lib\site-packages\pandas\io\stata.py", line 1242, in write_file self._write_data_nodates() File "C:\Python27\lib\site-packages\pandas\io\stata.py", line 1326, in _write_data_nodates self._write(var) File "C:\Python27\lib\site-packa...
UnicodeEncodeError
def _write_data_dates(self): convert_dates = self._convert_dates data = self.datarows byteorder = self._byteorder TYPE_MAP = self.TYPE_MAP MISSING_VALUES = self.MISSING_VALUES typlist = self.typlist for row in data: # row = row.squeeze().tolist() # needed for structured arrays ...
def _write_data_dates(self): convert_dates = self._convert_dates data = self.datarows byteorder = self._byteorder TYPE_MAP = self.TYPE_MAP MISSING_VALUES = self.MISSING_VALUES typlist = self.typlist for row in data: # row = row.squeeze().tolist() # needed for structured arrays ...
https://github.com/pandas-dev/pandas/issues/7286
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Python27\lib\site-packages\pandas\io\stata.py", line 1242, in write_file self._write_data_nodates() File "C:\Python27\lib\site-packages\pandas\io\stata.py", line 1326, in _write_data_nodates self._write(var) File "C:\Python27\lib\site-packa...
UnicodeEncodeError
def _read_header(self): first_char = self.path_or_buf.read(1) if struct.unpack("c", first_char)[0] == b"<": # format 117 or higher (XML like) self.path_or_buf.read(27) # stata_dta><header><release> self.format_version = int(self.path_or_buf.read(3)) if self.format_version not in...
def _read_header(self): first_char = self.path_or_buf.read(1) if struct.unpack("c", first_char)[0] == b"<": # format 117 or higher (XML like) self.path_or_buf.read(27) # stata_dta><header><release> self.format_version = int(self.path_or_buf.read(3)) if self.format_version not in...
https://github.com/pandas-dev/pandas/issues/7360
%run D:/Datos/RFERRER/Desktop/import_stata13.py INSTALLED VERSIONS ------------------ commit: None python: 2.7.6.final.0 python-bits: 64 OS: Windows OS-release: 7 machine: AMD64 processor: Intel64 Family 6 Model 45 Stepping 7, GenuineIntel byteorder: little LC_ALL: None LANG: None pandas: 0.14.0 nose: 1.3.0 Cython: 0...
TypeError
def rolling_count(arg, window, freq=None, center=False, how=None): """ Rolling count of number of non-NaN observations inside provided window. Parameters ---------- arg : DataFrame or numpy ndarray-like window : int Size of the moving window. This is the number of observations used for...
def rolling_count(arg, window, freq=None, center=False): """ Rolling count of number of non-NaN observations inside provided window. Parameters ---------- arg : DataFrame or numpy ndarray-like window : int Size of the moving window. This is the number of observations used for c...
https://github.com/pandas-dev/pandas/issues/6297
In [118]: import pandas In [119]: indices = [datetime.datetime(1975, 1, i, 12, 0) for i in range(1, 6)] In [120]: indices.append(datetime.datetime(1975, 1, 3, 6, 0)) # So that we can have 2 datapoints on one of the days In [121]: series = pandas.Series(range(1, 7), index=indices) In [122]: series = series.map(lamb...
AssertionError
def rolling_cov( arg1, arg2=None, window=None, min_periods=None, freq=None, center=False, pairwise=None, how=None, ): if window is None and isinstance(arg2, (int, float)): window = arg2 arg2 = arg1 pairwise = True if pairwise is None else pairwise # only defa...
def rolling_cov( arg1, arg2=None, window=None, min_periods=None, freq=None, center=False, pairwise=None, ): if window is None and isinstance(arg2, (int, float)): window = arg2 arg2 = arg1 pairwise = True if pairwise is None else pairwise # only default unset ...
https://github.com/pandas-dev/pandas/issues/6297
In [118]: import pandas In [119]: indices = [datetime.datetime(1975, 1, i, 12, 0) for i in range(1, 6)] In [120]: indices.append(datetime.datetime(1975, 1, 3, 6, 0)) # So that we can have 2 datapoints on one of the days In [121]: series = pandas.Series(range(1, 7), index=indices) In [122]: series = series.map(lamb...
AssertionError
def rolling_corr( arg1, arg2=None, window=None, min_periods=None, freq=None, center=False, pairwise=None, how=None, ): if window is None and isinstance(arg2, (int, float)): window = arg2 arg2 = arg1 pairwise = True if pairwise is None else pairwise # only def...
def rolling_corr( arg1, arg2=None, window=None, min_periods=None, freq=None, center=False, pairwise=None, ): if window is None and isinstance(arg2, (int, float)): window = arg2 arg2 = arg1 pairwise = True if pairwise is None else pairwise # only default unset ...
https://github.com/pandas-dev/pandas/issues/6297
In [118]: import pandas In [119]: indices = [datetime.datetime(1975, 1, i, 12, 0) for i in range(1, 6)] In [120]: indices.append(datetime.datetime(1975, 1, 3, 6, 0)) # So that we can have 2 datapoints on one of the days In [121]: series = pandas.Series(range(1, 7), index=indices) In [122]: series = series.map(lamb...
AssertionError
def _rolling_moment( arg, window, func, minp, axis=0, freq=None, center=False, how=None, args=(), kwargs={}, **kwds, ): """ Rolling statistical measure using supplied function. Designed to be used with passed-in Cython array-based functions. Parameters --...
def _rolling_moment( arg, window, func, minp, axis=0, freq=None, center=False, args=(), kwargs={}, **kwds ): """ Rolling statistical measure using supplied function. Designed to be used with passed-in Cython array-based functions. Parameters ---------- arg : DataFrame or numpy ndarray-like...
https://github.com/pandas-dev/pandas/issues/6297
In [118]: import pandas In [119]: indices = [datetime.datetime(1975, 1, i, 12, 0) for i in range(1, 6)] In [120]: indices.append(datetime.datetime(1975, 1, 3, 6, 0)) # So that we can have 2 datapoints on one of the days In [121]: series = pandas.Series(range(1, 7), index=indices) In [122]: series = series.map(lamb...
AssertionError
def ewma( arg, com=None, span=None, halflife=None, min_periods=0, freq=None, adjust=True, how=None, ): com = _get_center_of_mass(com, span, halflife) arg = _conv_timerule(arg, freq, how) def _ewma(v): result = algos.ewma(v, com, int(adjust)) first_index = _fi...
def ewma( arg, com=None, span=None, halflife=None, min_periods=0, freq=None, adjust=True ): com = _get_center_of_mass(com, span, halflife) arg = _conv_timerule(arg, freq) def _ewma(v): result = algos.ewma(v, com, int(adjust)) first_index = _first_valid_index(v) result[first_inde...
https://github.com/pandas-dev/pandas/issues/6297
In [118]: import pandas In [119]: indices = [datetime.datetime(1975, 1, i, 12, 0) for i in range(1, 6)] In [120]: indices.append(datetime.datetime(1975, 1, 3, 6, 0)) # So that we can have 2 datapoints on one of the days In [121]: series = pandas.Series(range(1, 7), index=indices) In [122]: series = series.map(lamb...
AssertionError
def ewmvar( arg, com=None, span=None, halflife=None, min_periods=0, bias=False, freq=None, how=None, ): com = _get_center_of_mass(com, span, halflife) arg = _conv_timerule(arg, freq, how) moment2nd = ewma(arg * arg, com=com, min_periods=min_periods) moment1st = ewma(arg, ...
def ewmvar( arg, com=None, span=None, halflife=None, min_periods=0, bias=False, freq=None ): com = _get_center_of_mass(com, span, halflife) arg = _conv_timerule(arg, freq) moment2nd = ewma(arg * arg, com=com, min_periods=min_periods) moment1st = ewma(arg, com=com, min_periods=min_periods) resul...
https://github.com/pandas-dev/pandas/issues/6297
In [118]: import pandas In [119]: indices = [datetime.datetime(1975, 1, i, 12, 0) for i in range(1, 6)] In [120]: indices.append(datetime.datetime(1975, 1, 3, 6, 0)) # So that we can have 2 datapoints on one of the days In [121]: series = pandas.Series(range(1, 7), index=indices) In [122]: series = series.map(lamb...
AssertionError
def ewmcov( arg1, arg2=None, com=None, span=None, halflife=None, min_periods=0, bias=False, freq=None, pairwise=None, how=None, ): if arg2 is None: arg2 = arg1 pairwise = True if pairwise is None else pairwise elif isinstance(arg2, (int, float)) and com is...
def ewmcov( arg1, arg2=None, com=None, span=None, halflife=None, min_periods=0, bias=False, freq=None, pairwise=None, ): if arg2 is None: arg2 = arg1 pairwise = True if pairwise is None else pairwise elif isinstance(arg2, (int, float)) and com is None: ...
https://github.com/pandas-dev/pandas/issues/6297
In [118]: import pandas In [119]: indices = [datetime.datetime(1975, 1, i, 12, 0) for i in range(1, 6)] In [120]: indices.append(datetime.datetime(1975, 1, 3, 6, 0)) # So that we can have 2 datapoints on one of the days In [121]: series = pandas.Series(range(1, 7), index=indices) In [122]: series = series.map(lamb...
AssertionError
def ewmcorr( arg1, arg2=None, com=None, span=None, halflife=None, min_periods=0, freq=None, pairwise=None, how=None, ): if arg2 is None: arg2 = arg1 pairwise = True if pairwise is None else pairwise elif isinstance(arg2, (int, float)) and com is None: ...
def ewmcorr( arg1, arg2=None, com=None, span=None, halflife=None, min_periods=0, freq=None, pairwise=None, ): if arg2 is None: arg2 = arg1 pairwise = True if pairwise is None else pairwise elif isinstance(arg2, (int, float)) and com is None: com = arg2 ...
https://github.com/pandas-dev/pandas/issues/6297
In [118]: import pandas In [119]: indices = [datetime.datetime(1975, 1, i, 12, 0) for i in range(1, 6)] In [120]: indices.append(datetime.datetime(1975, 1, 3, 6, 0)) # So that we can have 2 datapoints on one of the days In [121]: series = pandas.Series(range(1, 7), index=indices) In [122]: series = series.map(lamb...
AssertionError
def _conv_timerule(arg, freq, how): types = (DataFrame, Series) if freq is not None and isinstance(arg, types): # Conform to whatever frequency needed. arg = arg.resample(freq, how=how) return arg
def _conv_timerule(arg, freq): types = (DataFrame, Series) if freq is not None and isinstance(arg, types): # Conform to whatever frequency needed. arg = arg.resample(freq) return arg
https://github.com/pandas-dev/pandas/issues/6297
In [118]: import pandas In [119]: indices = [datetime.datetime(1975, 1, i, 12, 0) for i in range(1, 6)] In [120]: indices.append(datetime.datetime(1975, 1, 3, 6, 0)) # So that we can have 2 datapoints on one of the days In [121]: series = pandas.Series(range(1, 7), index=indices) In [122]: series = series.map(lamb...
AssertionError
def _rolling_func(func, desc, check_minp=_use_window, how=None): if how is None: how_arg_str = "None" else: how_arg_str = "'%s" % how @Substitution( desc, _unary_arg, _roll_kw % how_arg_str, _type_of_input_retval, _roll_notes ) @Appender(_doc_template) @wraps(func) d...
def _rolling_func(func, desc, check_minp=_use_window): @Substitution(desc, _unary_arg, _roll_kw, _type_of_input_retval, _roll_notes) @Appender(_doc_template) @wraps(func) def f(arg, window, min_periods=None, freq=None, center=False, **kwargs): def call_cython(arg, window, minp, args=(), kwargs={...
https://github.com/pandas-dev/pandas/issues/6297
In [118]: import pandas In [119]: indices = [datetime.datetime(1975, 1, i, 12, 0) for i in range(1, 6)] In [120]: indices.append(datetime.datetime(1975, 1, 3, 6, 0)) # So that we can have 2 datapoints on one of the days In [121]: series = pandas.Series(range(1, 7), index=indices) In [122]: series = series.map(lamb...
AssertionError
def f(arg, window, min_periods=None, freq=None, center=False, how=how, **kwargs): def call_cython(arg, window, minp, args=(), kwargs={}, **kwds): minp = check_minp(minp, window) return func(arg, window, minp, **kwds) return _rolling_moment( arg, window, call_cython, ...
def f(arg, window, min_periods=None, freq=None, center=False, **kwargs): def call_cython(arg, window, minp, args=(), kwargs={}, **kwds): minp = check_minp(minp, window) return func(arg, window, minp, **kwds) return _rolling_moment( arg, window, call_cython, min_periods, freq=freq, cente...
https://github.com/pandas-dev/pandas/issues/6297
In [118]: import pandas In [119]: indices = [datetime.datetime(1975, 1, i, 12, 0) for i in range(1, 6)] In [120]: indices.append(datetime.datetime(1975, 1, 3, 6, 0)) # So that we can have 2 datapoints on one of the days In [121]: series = pandas.Series(range(1, 7), index=indices) In [122]: series = series.map(lamb...
AssertionError
def rolling_window( arg, window=None, win_type=None, min_periods=None, freq=None, center=False, mean=True, axis=0, how=None, **kwargs, ): """ Applies a moving window of type ``window_type`` and size ``window`` on the data. Parameters ---------- arg : Seri...
def rolling_window( arg, window=None, win_type=None, min_periods=None, freq=None, center=False, mean=True, axis=0, **kwargs, ): """ Applies a moving window of type ``window_type`` and size ``window`` on the data. Parameters ---------- arg : Series, DataFrame ...
https://github.com/pandas-dev/pandas/issues/6297
In [118]: import pandas In [119]: indices = [datetime.datetime(1975, 1, i, 12, 0) for i in range(1, 6)] In [120]: indices.append(datetime.datetime(1975, 1, 3, 6, 0)) # So that we can have 2 datapoints on one of the days In [121]: series = pandas.Series(range(1, 7), index=indices) In [122]: series = series.map(lamb...
AssertionError
def _get_time_period_bins(self, axis): if not isinstance(axis, DatetimeIndex): raise TypeError( "axis must be a DatetimeIndex, but got " "an instance of %r" % type(axis).__name__ ) if not len(axis): binner = labels = PeriodIndex(data=[], freq=self.freq) r...
def _get_time_period_bins(self, axis): if not isinstance(axis, DatetimeIndex): raise TypeError( "axis must be a DatetimeIndex, but got " "an instance of %r" % type(axis).__name__ ) if not len(axis): binner = labels = PeriodIndex(data=[], freq=self.freq) r...
https://github.com/pandas-dev/pandas/issues/3609
In [20]: s.resample('T', kind='period') ----------------- AssertionError Traceback (most recent call last) <ipython-input-79-c290c0578332> in <module>() ----> 1 s.resample('T', kind='period') /home/dk3810/workspace/python/pda/scripts/src/pandas/pandas/core/generic.py in resample(self, rule, how, axis, fill_method, clo...
AssertionError
def filter(self, func, dropna=True, *args, **kwargs): """ Return a copy of a Series excluding elements from groups that do not satisfy the boolean criterion specified by func. Parameters ---------- func : function To apply to each group. Should return True or False. dropna : Drop gr...
def filter(self, func, dropna=True, *args, **kwargs): """ Return a copy of a Series excluding elements from groups that do not satisfy the boolean criterion specified by func. Parameters ---------- func : function To apply to each group. Should return True or False. dropna : Drop gr...
https://github.com/pandas-dev/pandas/issues/4447
In [90]: dff = pd.DataFrame({'A': np.arange(8), 'B': list('aabbbbcc'), 'C': np.arange(8)}) In [91]: dff.groupby('B').filter(lambda x: len(x) > 2) --------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-91-89d...
ValueError
def filter(self, func, dropna=True, *args, **kwargs): """ Return a copy of a DataFrame excluding elements from groups that do not satisfy the boolean criterion specified by func. Parameters ---------- f : function Function to apply to each subframe. Should return True or False. drop...
def filter(self, func, dropna=True, *args, **kwargs): """ Return a copy of a DataFrame excluding elements from groups that do not satisfy the boolean criterion specified by func. Parameters ---------- f : function Function to apply to each subframe. Should return True or False. drop...
https://github.com/pandas-dev/pandas/issues/4447
In [90]: dff = pd.DataFrame({'A': np.arange(8), 'B': list('aabbbbcc'), 'C': np.arange(8)}) In [91]: dff.groupby('B').filter(lambda x: len(x) > 2) --------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-91-89d...
ValueError
def reshape(self, *args, **kwargs): """ See numpy.ndarray.reshape """ if len(args) == 1 and hasattr(args[0], "__iter__"): shape = args[0] else: shape = args if tuple(shape) == self.shape: # XXX ignoring the "order" keyword. return self return self.values.res...
def reshape(self, newshape, order="C"): """ See numpy.ndarray.reshape """ if order not in ["C", "F"]: raise TypeError("must specify a tuple / singular length to reshape") if isinstance(newshape, tuple) and len(newshape) > 1: return self.values.reshape(newshape, order=order) else...
https://github.com/pandas-dev/pandas/issues/4554
import pandas as pd x = pd.Series(range(5)) x.reshape(x.shape) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/pymodules/python2.7/pandas/core/series.py", line 981, in reshape return ndarray.reshape(self, newshape, order) TypeError: an integer is required
TypeError
def __getitem__(self, key): try: if type(key) == tuple and len(key) == 1: key = key[0] return self.index.get_value(self, key) except InvalidIndexError: pass except KeyError: if isinstance(key, tuple) and isinstance(self.index, MultiIndex): # kludge ...
def __getitem__(self, key): try: return self.index.get_value(self, key) except InvalidIndexError: pass except KeyError: if isinstance(key, tuple) and isinstance(self.index, MultiIndex): # kludge pass else: raise except Exception: ...
https://github.com/pandas-dev/pandas/issues/816
In [13]: s = Series(np.arange(10)) In [14]: np.diff(s) --------------------------------------------------------------------------- ValueError Traceback (most recent call last) /home/wesm/code/pandas/<ipython-input-14-b5f9fe77ab7c> in <module>() ----> 1 np.diff(s) /usr/lib/epd-7.1/lib/py...
ValueError
def __getitem__(self, key): try: return self.index.get_value(self, key) except InvalidIndexError: pass except KeyError: if isinstance(key, tuple) and isinstance(self.index, MultiIndex): # kludge pass else: raise except Exception: ...
def __getitem__(self, key): try: if type(key) == tuple and len(key) == 1: key = key[0] return self.index.get_value(self, key) except InvalidIndexError: pass except KeyError: if isinstance(key, tuple) and isinstance(self.index, MultiIndex): # kludge ...
https://github.com/pandas-dev/pandas/issues/816
In [13]: s = Series(np.arange(10)) In [14]: np.diff(s) --------------------------------------------------------------------------- ValueError Traceback (most recent call last) /home/wesm/code/pandas/<ipython-input-14-b5f9fe77ab7c> in <module>() ----> 1 np.diff(s) /usr/lib/epd-7.1/lib/py...
ValueError
def _get_with(self, key): # other: fancy integer or otherwise if isinstance(key, slice): from pandas.core.indexing import _is_index_slice if self.index.inferred_type == "integer" or _is_index_slice(key): indexer = key else: indexer = self.ix._convert_to_indexer(k...
def _get_with(self, key): # other: fancy integer or otherwise if isinstance(key, slice): from pandas.core.indexing import _is_index_slice if self.index.inferred_type == "integer" or _is_index_slice(key): indexer = key else: indexer = self.ix._convert_to_indexer(k...
https://github.com/pandas-dev/pandas/issues/816
In [13]: s = Series(np.arange(10)) In [14]: np.diff(s) --------------------------------------------------------------------------- ValueError Traceback (most recent call last) /home/wesm/code/pandas/<ipython-input-14-b5f9fe77ab7c> in <module>() ----> 1 np.diff(s) /usr/lib/epd-7.1/lib/py...
ValueError
def match(to_match, values, na_sentinel=-1): """ Compute locations of to_match into values Parameters ---------- to_match : array-like values to find positions of values : array-like Unique set of values na_sentinel : int, default -1 Value to mark "not found" Ex...
def match(to_match, values, na_sentinel=-1): """ Compute locations of to_match into values Parameters ---------- to_match : array-like values to find positions of values : array-like Unique set of values na_sentinel : int, default -1 Value to mark "not found" Ex...
https://github.com/pandas-dev/pandas/issues/1943
In [25]: df = pandas.DataFrame(np.random.randn(4,4), columns=list('AABC')) In [26]: df Out[26]: A A B C 0 -0.174905 0.332522 1.134984 -0.201270 1 1.730445 0.382556 -0.607761 1.221815 2 0.513049 0.196231 -1.746732 -0.252282 3 -0.297577 -1.000121 -0.090442 -2.129467 In [27]: df.ix[:,['A',...
Exception
def _isnull_ndarraylike(obj): from pandas import Series values = np.asarray(obj) if values.dtype.kind in ("O", "S", "U"): # Working around NumPy ticket 1542 shape = values.shape if values.dtype.kind in ("S", "U"): result = np.zeros(values.shape, dtype=bool) els...
def _isnull_ndarraylike(obj): from pandas import Series values = np.asarray(obj) if values.dtype.kind in ("O", "S"): # Working around NumPy ticket 1542 shape = values.shape result = np.empty(shape, dtype=bool) vec = lib.isnullobj(values.ravel()) result[:] = vec.resh...
https://github.com/pandas-dev/pandas/issues/1943
In [25]: df = pandas.DataFrame(np.random.randn(4,4), columns=list('AABC')) In [26]: df Out[26]: A A B C 0 -0.174905 0.332522 1.134984 -0.201270 1 1.730445 0.382556 -0.607761 1.221815 2 0.513049 0.196231 -1.746732 -0.252282 3 -0.297577 -1.000121 -0.090442 -2.129467 In [27]: df.ix[:,['A',...
Exception
def pad_2d(values, limit=None, mask=None): if is_float_dtype(values): _method = _algos.pad_2d_inplace_float64 elif is_datetime64_dtype(values): _method = _pad_2d_datetime elif values.dtype == np.object_: _method = _algos.pad_2d_inplace_object else: # pragma: no cover rai...
def pad_2d(values, limit=None, mask=None): if is_float_dtype(values): _method = _algos.pad_2d_inplace_float64 elif is_datetime64_dtype(values): _method = _pad_2d_datetime elif values.dtype == np.object_: _method = _algos.pad_2d_inplace_object else: # pragma: no cover rai...
https://github.com/pandas-dev/pandas/issues/1943
In [25]: df = pandas.DataFrame(np.random.randn(4,4), columns=list('AABC')) In [26]: df Out[26]: A A B C 0 -0.174905 0.332522 1.134984 -0.201270 1 1.730445 0.382556 -0.607761 1.221815 2 0.513049 0.196231 -1.746732 -0.252282 3 -0.297577 -1.000121 -0.090442 -2.129467 In [27]: df.ix[:,['A',...
Exception
def backfill_2d(values, limit=None, mask=None): if is_float_dtype(values): _method = _algos.backfill_2d_inplace_float64 elif is_datetime64_dtype(values): _method = _backfill_2d_datetime elif values.dtype == np.object_: _method = _algos.backfill_2d_inplace_object else: # pragma: ...
def backfill_2d(values, limit=None, mask=None): if is_float_dtype(values): _method = _algos.backfill_2d_inplace_float64 elif is_datetime64_dtype(values): _method = _backfill_2d_datetime elif values.dtype == np.object_: _method = _algos.backfill_2d_inplace_object else: # pragma: ...
https://github.com/pandas-dev/pandas/issues/1943
In [25]: df = pandas.DataFrame(np.random.randn(4,4), columns=list('AABC')) In [26]: df Out[26]: A A B C 0 -0.174905 0.332522 1.134984 -0.201270 1 1.730445 0.382556 -0.607761 1.221815 2 0.513049 0.196231 -1.746732 -0.252282 3 -0.297577 -1.000121 -0.090442 -2.129467 In [27]: df.ix[:,['A',...
Exception
def _asarray_tuplesafe(values, dtype=None): from pandas.core.index import Index if not isinstance(values, (list, tuple, np.ndarray)): values = list(values) elif isinstance(values, Index): return values.values if isinstance(values, list) and dtype in [np.object_, object]: return...
def _asarray_tuplesafe(values, dtype=None): if not isinstance(values, (list, tuple, np.ndarray)): values = list(values) if isinstance(values, list) and dtype in [np.object_, object]: return lib.list_to_object_array(values) result = np.asarray(values, dtype=dtype) if issubclass(result....
https://github.com/pandas-dev/pandas/issues/1943
In [25]: df = pandas.DataFrame(np.random.randn(4,4), columns=list('AABC')) In [26]: df Out[26]: A A B C 0 -0.174905 0.332522 1.134984 -0.201270 1 1.730445 0.382556 -0.607761 1.221815 2 0.513049 0.196231 -1.746732 -0.252282 3 -0.297577 -1.000121 -0.090442 -2.129467 In [27]: df.ix[:,['A',...
Exception
def console_encode(value): if py3compat.PY3 or not isinstance(value, unicode): return value try: import sys return value.encode(sys.stdin.encoding or "utf-8", "replace") except (AttributeError, TypeError): return value.encode("ascii", "replace")
def console_encode(value): if py3compat.PY3 or not isinstance(value, unicode): return value try: import sys return value.encode(sys.stdin.encoding, "replace") except (AttributeError, TypeError): return value.encode("ascii", "replace")
https://github.com/pandas-dev/pandas/issues/1943
In [25]: df = pandas.DataFrame(np.random.randn(4,4), columns=list('AABC')) In [26]: df Out[26]: A A B C 0 -0.174905 0.332522 1.134984 -0.201270 1 1.730445 0.382556 -0.607761 1.221815 2 0.513049 0.196231 -1.746732 -0.252282 3 -0.297577 -1.000121 -0.090442 -2.129467 In [27]: df.ix[:,['A',...
Exception
def reindex_axis(self, new_axis, method=None, axis=0, copy=True): new_axis = _ensure_index(new_axis) cur_axis = self.axes[axis] if new_axis.equals(cur_axis): if copy: result = self.copy(deep=True) result.axes[axis] = new_axis if axis == 0: # patc...
def reindex_axis(self, new_axis, method=None, axis=0, copy=True): new_axis = _ensure_index(new_axis) cur_axis = self.axes[axis] if new_axis.equals(cur_axis): if copy: result = self.copy(deep=True) result.axes[axis] = new_axis return result else: ...
https://github.com/pandas-dev/pandas/issues/1943
In [25]: df = pandas.DataFrame(np.random.randn(4,4), columns=list('AABC')) In [26]: df Out[26]: A A B C 0 -0.174905 0.332522 1.134984 -0.201270 1 1.730445 0.382556 -0.607761 1.221815 2 0.513049 0.196231 -1.746732 -0.252282 3 -0.297577 -1.000121 -0.090442 -2.129467 In [27]: df.ix[:,['A',...
Exception
def form_blocks(data, axes): # pre-filter out items if we passed it items = axes[0] if len(data) < len(items): extra_items = items - Index(data.keys()) else: extra_items = [] # put "leftover" items in float bucket, where else? # generalize? float_dict = {} complex_dict ...
def form_blocks(data, axes): # pre-filter out items if we passed it items = axes[0] if len(data) < len(items): extra_items = items - Index(data.keys()) else: extra_items = [] # put "leftover" items in float bucket, where else? # generalize? float_dict = {} complex_dict ...
https://github.com/pandas-dev/pandas/issues/1943
In [25]: df = pandas.DataFrame(np.random.randn(4,4), columns=list('AABC')) In [26]: df Out[26]: A A B C 0 -0.174905 0.332522 1.134984 -0.201270 1 1.730445 0.382556 -0.607761 1.221815 2 0.513049 0.196231 -1.746732 -0.252282 3 -0.297577 -1.000121 -0.090442 -2.129467 In [27]: df.ix[:,['A',...
Exception
def __setitem__(self, key, value): _, N, K = self.shape if isinstance(value, DataFrame): value = value.reindex(index=self.major_axis, columns=self.minor_axis) mat = value.values elif isinstance(value, np.ndarray): assert value.shape == (N, K) mat = np.asarray(value) elif ...
def __setitem__(self, key, value): _, N, K = self.shape if isinstance(value, DataFrame): value = value.reindex(index=self.major_axis, columns=self.minor_axis) mat = value.values elif isinstance(value, np.ndarray): assert value.shape == (N, K) mat = np.asarray(value) elif ...
https://github.com/pandas-dev/pandas/issues/1943
In [25]: df = pandas.DataFrame(np.random.randn(4,4), columns=list('AABC')) In [26]: df Out[26]: A A B C 0 -0.174905 0.332522 1.134984 -0.201270 1 1.730445 0.382556 -0.607761 1.221815 2 0.513049 0.196231 -1.746732 -0.252282 3 -0.297577 -1.000121 -0.090442 -2.129467 In [27]: df.ix[:,['A',...
Exception
def get_new_values(self): values = self.values # place the values length, width = self.full_shape stride = values.shape[1] result_width = width * stride new_values = np.empty((length, result_width), dtype=values.dtype) new_mask = np.zeros((length, result_width), dtype=bool) new_values ...
def get_new_values(self): values = self.values # place the values length, width = self.full_shape stride = values.shape[1] result_width = width * stride new_values = np.empty((length, result_width), dtype=values.dtype) new_mask = np.zeros((length, result_width), dtype=bool) if issubcla...
https://github.com/pandas-dev/pandas/issues/1943
In [25]: df = pandas.DataFrame(np.random.randn(4,4), columns=list('AABC')) In [26]: df Out[26]: A A B C 0 -0.174905 0.332522 1.134984 -0.201270 1 1.730445 0.382556 -0.607761 1.221815 2 0.513049 0.196231 -1.746732 -0.252282 3 -0.297577 -1.000121 -0.090442 -2.129467 In [27]: df.ix[:,['A',...
Exception
def str_contains(arr, pat, case=True, flags=0, na=np.nan): """ Check whether given pattern is contained in each string in the array Parameters ---------- pat : string Character sequence or regular expression case : boolean, default True If True, case sensitive flags : int, d...
def str_contains(arr, pat, case=True, flags=0): """ Check whether given pattern is contained in each string in the array Parameters ---------- pat : string Character sequence or regular expression case : boolean, default True If True, case sensitive flags : int, default 0 (n...
https://github.com/pandas-dev/pandas/issues/1943
In [25]: df = pandas.DataFrame(np.random.randn(4,4), columns=list('AABC')) In [26]: df Out[26]: A A B C 0 -0.174905 0.332522 1.134984 -0.201270 1 1.730445 0.382556 -0.607761 1.221815 2 0.513049 0.196231 -1.746732 -0.252282 3 -0.297577 -1.000121 -0.090442 -2.129467 In [27]: df.ix[:,['A',...
Exception
def str_startswith(arr, pat, na=np.nan): """ Return boolean array indicating whether each string starts with passed pattern Parameters ---------- pat : string Character sequence na : bool, default NaN Returns ------- startswith : array (boolean) """ f = lambda x...
def str_startswith(arr, pat): """ Return boolean array indicating whether each string starts with passed pattern Parameters ---------- pat : string Character sequence Returns ------- startswith : array (boolean) """ f = lambda x: x.startswith(pat) return _na_map...
https://github.com/pandas-dev/pandas/issues/1943
In [25]: df = pandas.DataFrame(np.random.randn(4,4), columns=list('AABC')) In [26]: df Out[26]: A A B C 0 -0.174905 0.332522 1.134984 -0.201270 1 1.730445 0.382556 -0.607761 1.221815 2 0.513049 0.196231 -1.746732 -0.252282 3 -0.297577 -1.000121 -0.090442 -2.129467 In [27]: df.ix[:,['A',...
Exception
def str_endswith(arr, pat, na=np.nan): """ Return boolean array indicating whether each string ends with passed pattern Parameters ---------- pat : string Character sequence na : bool, default NaN Returns ------- endswith : array (boolean) """ f = lambda x: x.en...
def str_endswith(arr, pat): """ Return boolean array indicating whether each string ends with passed pattern Parameters ---------- pat : string Character sequence Returns ------- endswith : array (boolean) """ f = lambda x: x.endswith(pat) return _na_map(f, arr)...
https://github.com/pandas-dev/pandas/issues/1943
In [25]: df = pandas.DataFrame(np.random.randn(4,4), columns=list('AABC')) In [26]: df Out[26]: A A B C 0 -0.174905 0.332522 1.134984 -0.201270 1 1.730445 0.382556 -0.607761 1.221815 2 0.513049 0.196231 -1.746732 -0.252282 3 -0.297577 -1.000121 -0.090442 -2.129467 In [27]: df.ix[:,['A',...
Exception
def str_split(arr, pat=None, n=0): """ Split each string (a la re.split) in array by given pattern, propagating NA values Parameters ---------- pat : string, default None String or regular expression to split on. If None, splits on whitespace n : int, default 0 (all) Returns ...
def str_split(arr, pat, n=0): """ Split each string (a la re.split) in array by given pattern, propagating NA values Parameters ---------- pat : string String or regular expression to split on n : int, default 0 (all) Returns ------- split : array """ regex = re...
https://github.com/pandas-dev/pandas/issues/1943
In [25]: df = pandas.DataFrame(np.random.randn(4,4), columns=list('AABC')) In [26]: df Out[26]: A A B C 0 -0.174905 0.332522 1.134984 -0.201270 1 1.730445 0.382556 -0.607761 1.221815 2 0.513049 0.196231 -1.746732 -0.252282 3 -0.297577 -1.000121 -0.090442 -2.129467 In [27]: df.ix[:,['A',...
Exception
def _pat_wrapper(f, flags=False, na=False): def wrapper1(self, pat): result = f(self.series, pat) return self._wrap_result(result) def wrapper2(self, pat, flags=0): result = f(self.series, pat, flags=flags) return self._wrap_result(result) def wrapper3(self, pat, na=np.nan)...
def _pat_wrapper(f, flags=False): def wrapper1(self, pat): result = f(self.series, pat) return self._wrap_result(result) def wrapper2(self, pat, flags=0): result = f(self.series, pat, flags=flags) return self._wrap_result(result) wrapper = wrapper2 if flags else wrapper1 ...
https://github.com/pandas-dev/pandas/issues/1943
In [25]: df = pandas.DataFrame(np.random.randn(4,4), columns=list('AABC')) In [26]: df Out[26]: A A B C 0 -0.174905 0.332522 1.134984 -0.201270 1 1.730445 0.382556 -0.607761 1.221815 2 0.513049 0.196231 -1.746732 -0.252282 3 -0.297577 -1.000121 -0.090442 -2.129467 In [27]: df.ix[:,['A',...
Exception
def split(self, pat=None, n=0): result = str_split(self.series, pat, n=n) return self._wrap_result(result)
def split(self, pat, n=0): result = str_split(self.series, pat, n=n) return self._wrap_result(result)
https://github.com/pandas-dev/pandas/issues/1943
In [25]: df = pandas.DataFrame(np.random.randn(4,4), columns=list('AABC')) In [26]: df Out[26]: A A B C 0 -0.174905 0.332522 1.134984 -0.201270 1 1.730445 0.382556 -0.607761 1.221815 2 0.513049 0.196231 -1.746732 -0.252282 3 -0.297577 -1.000121 -0.090442 -2.129467 In [27]: df.ix[:,['A',...
Exception
def contains(self, pat, case=True, flags=0, na=np.nan): result = str_contains(self.series, pat, case=case, flags=flags, na=np.nan) return self._wrap_result(result)
def contains(self, pat, case=True, flags=0): result = str_contains(self.series, pat, case=case, flags=flags) return self._wrap_result(result)
https://github.com/pandas-dev/pandas/issues/1943
In [25]: df = pandas.DataFrame(np.random.randn(4,4), columns=list('AABC')) In [26]: df Out[26]: A A B C 0 -0.174905 0.332522 1.134984 -0.201270 1 1.730445 0.382556 -0.607761 1.221815 2 0.513049 0.196231 -1.746732 -0.252282 3 -0.297577 -1.000121 -0.090442 -2.129467 In [27]: df.ix[:,['A',...
Exception
def as_matrix(self, columns=None): """ Convert the frame to its Numpy-array matrix representation Columns are presented in sorted order unless a specific list of columns is provided. """ if columns is None: columns = self.columns if len(columns) == 0: return np.zeros((len(s...
def as_matrix(self, columns=None): """ Convert the frame to its Numpy-array matrix representation Columns are presented in sorted order unless a specific list of columns is provided. """ if columns is None: columns = self.columns if len(columns) == 0: return np.zeros((len(s...
https://github.com/pandas-dev/pandas/issues/1943
In [25]: df = pandas.DataFrame(np.random.randn(4,4), columns=list('AABC')) In [26]: df Out[26]: A A B C 0 -0.174905 0.332522 1.134984 -0.201270 1 1.730445 0.382556 -0.607761 1.221815 2 0.513049 0.196231 -1.746732 -0.252282 3 -0.297577 -1.000121 -0.090442 -2.129467 In [27]: df.ix[:,['A',...
Exception
def _first_valid_index(arr): # argmax scans from left return notnull(arr).argmax() if len(arr) else 0
def _first_valid_index(arr): # argmax scans from left return notnull(arr).argmax()
https://github.com/pandas-dev/pandas/issues/1943
In [25]: df = pandas.DataFrame(np.random.randn(4,4), columns=list('AABC')) In [26]: df Out[26]: A A B C 0 -0.174905 0.332522 1.134984 -0.201270 1 1.730445 0.382556 -0.607761 1.221815 2 0.513049 0.196231 -1.746732 -0.252282 3 -0.297577 -1.000121 -0.090442 -2.129467 In [27]: df.ix[:,['A',...
Exception
def ewmstd(arg, com=None, span=None, min_periods=0, bias=False, time_rule=None): result = ewmvar( arg, com=com, span=span, time_rule=time_rule, min_periods=min_periods, bias=bias ) return _zsqrt(result)
def ewmstd(arg, com=None, span=None, min_periods=0, bias=False, time_rule=None): result = ewmvar( arg, com=com, span=span, time_rule=time_rule, min_periods=min_periods, bias=bias ) return np.sqrt(result)
https://github.com/pandas-dev/pandas/issues/1943
In [25]: df = pandas.DataFrame(np.random.randn(4,4), columns=list('AABC')) In [26]: df Out[26]: A A B C 0 -0.174905 0.332522 1.134984 -0.201270 1 1.730445 0.382556 -0.607761 1.221815 2 0.513049 0.196231 -1.746732 -0.252282 3 -0.297577 -1.000121 -0.090442 -2.129467 In [27]: df.ix[:,['A',...
Exception
def ewmcorr(arg1, arg2, com=None, span=None, min_periods=0, freq=None, time_rule=None): X, Y = _prep_binary(arg1, arg2) X = _conv_timerule(X, freq, time_rule) Y = _conv_timerule(Y, freq, time_rule) mean = lambda x: ewma(x, com=com, span=span, min_periods=min_periods) var = lambda x: ewmvar(x, com=...
def ewmcorr(arg1, arg2, com=None, span=None, min_periods=0, freq=None, time_rule=None): X, Y = _prep_binary(arg1, arg2) X = _conv_timerule(X, freq, time_rule) Y = _conv_timerule(Y, freq, time_rule) mean = lambda x: ewma(x, com=com, span=span, min_periods=min_periods) var = lambda x: ewmvar(x, com=...
https://github.com/pandas-dev/pandas/issues/1943
In [25]: df = pandas.DataFrame(np.random.randn(4,4), columns=list('AABC')) In [26]: df Out[26]: A A B C 0 -0.174905 0.332522 1.134984 -0.201270 1 1.730445 0.382556 -0.607761 1.221815 2 0.513049 0.196231 -1.746732 -0.252282 3 -0.297577 -1.000121 -0.090442 -2.129467 In [27]: df.ix[:,['A',...
Exception
def f(arg, min_periods=1, freq=None, time_rule=None, **kwargs): window = len(arg) def call_cython(arg, window, minp, **kwds): minp = check_minp(minp, window) return func(arg, window, minp, **kwds) return _rolling_moment( arg, window, call_cython, min_periods, freq=freq, time_rule=t...
def f(arg, window, min_periods=None, freq=None, time_rule=None, **kwargs): def call_cython(arg, window, minp, **kwds): minp = check_minp(minp, window) return func(arg, window, minp, **kwds) return _rolling_moment( arg, window, call_cython, min_periods, freq=freq, time_rule=time_rule, **...
https://github.com/pandas-dev/pandas/issues/1943
In [25]: df = pandas.DataFrame(np.random.randn(4,4), columns=list('AABC')) In [26]: df Out[26]: A A B C 0 -0.174905 0.332522 1.134984 -0.201270 1 1.730445 0.382556 -0.607761 1.221815 2 0.513049 0.196231 -1.746732 -0.252282 3 -0.297577 -1.000121 -0.090442 -2.129467 In [27]: df.ix[:,['A',...
Exception
def summary(self): """ This returns the formatted result of the OLS computation """ template = """ %(bannerTop)s Formula: Y ~ %(formula)s Number of Observations: %(nobs)d Number of Degrees of Freedom: %(df)d R-squared: %(r2)10.4f Adj R-squared: %(r2_adj)10.4f Rmse: %(rmse)10.4...
def summary(self): """ This returns the formatted result of the OLS computation """ template = """ %(bannerTop)s Formula: Y ~ %(formula)s Number of Observations: %(nobs)d Number of Degrees of Freedom: %(df)d R-squared: %(r2)10.4f Adj R-squared: %(r2_adj)10.4f Rmse: %(rmse)10.4...
https://github.com/pandas-dev/pandas/issues/1943
In [25]: df = pandas.DataFrame(np.random.randn(4,4), columns=list('AABC')) In [26]: df Out[26]: A A B C 0 -0.174905 0.332522 1.134984 -0.201270 1 1.730445 0.382556 -0.607761 1.221815 2 0.513049 0.196231 -1.746732 -0.252282 3 -0.297577 -1.000121 -0.090442 -2.129467 In [27]: df.ix[:,['A',...
Exception
def _make_plot(self): # this is slightly deceptive if self.use_index and self._use_dynamic_x(): data = self._maybe_convert_index(self.data) self._make_ts_plot(data, **self.kwds) else: lines = [] labels = [] x = self._get_xticks(convert_period=True) has_colors...
def _make_plot(self): # this is slightly deceptive if self.use_index and self._use_dynamic_x(): data = self._maybe_convert_index(self.data) self._make_ts_plot(data, **self.kwds) else: lines = [] labels = [] x = self._get_xticks(convert_period=True) has_colors...
https://github.com/pandas-dev/pandas/issues/1943
In [25]: df = pandas.DataFrame(np.random.randn(4,4), columns=list('AABC')) In [26]: df Out[26]: A A B C 0 -0.174905 0.332522 1.134984 -0.201270 1 1.730445 0.382556 -0.607761 1.221815 2 0.513049 0.196231 -1.746732 -0.252282 3 -0.297577 -1.000121 -0.090442 -2.129467 In [27]: df.ix[:,['A',...
Exception
def _maybe_add_color(kwargs, style, i): if ( not has_colors and (style is None or re.match("[a-z]+", style) is None) and "color" not in kwargs ): kwargs["color"] = colors[i % len(colors)]
def _maybe_add_color(kwargs, style, i): if not has_colors and (style is None or re.match("[a-z]+", style) is None): kwargs["color"] = colors[i % len(colors)]
https://github.com/pandas-dev/pandas/issues/1943
In [25]: df = pandas.DataFrame(np.random.randn(4,4), columns=list('AABC')) In [26]: df Out[26]: A A B C 0 -0.174905 0.332522 1.134984 -0.201270 1 1.730445 0.382556 -0.607761 1.221815 2 0.513049 0.196231 -1.746732 -0.252282 3 -0.297577 -1.000121 -0.090442 -2.129467 In [27]: df.ix[:,['A',...
Exception
def plot_frame( frame=None, x=None, y=None, subplots=False, sharex=True, sharey=False, use_index=True, figsize=None, grid=False, legend=True, rot=None, ax=None, style=None, title=None, xlim=None, ylim=None, logy=False, xticks=None, yticks=None,...
def plot_frame( frame=None, x=None, y=None, subplots=False, sharex=True, sharey=False, use_index=True, figsize=None, grid=False, legend=True, rot=None, ax=None, style=None, title=None, xlim=None, ylim=None, logy=False, xticks=None, yticks=None,...
https://github.com/pandas-dev/pandas/issues/1943
In [25]: df = pandas.DataFrame(np.random.randn(4,4), columns=list('AABC')) In [26]: df Out[26]: A A B C 0 -0.174905 0.332522 1.134984 -0.201270 1 1.730445 0.382556 -0.607761 1.221815 2 0.513049 0.196231 -1.746732 -0.252282 3 -0.297577 -1.000121 -0.090442 -2.129467 In [27]: df.ix[:,['A',...
Exception
def __new__( cls, data=None, freq=None, start=None, end=None, periods=None, copy=False, name=None, tz=None, verify_integrity=True, normalize=False, **kwds, ): dayfirst = kwds.pop("dayfirst", None) yearfirst = kwds.pop("yearfirst", None) warn = False if "of...
def __new__( cls, data=None, freq=None, start=None, end=None, periods=None, copy=False, name=None, tz=None, verify_integrity=True, normalize=False, **kwds, ): dayfirst = kwds.pop("dayfirst", None) yearfirst = kwds.pop("yearfirst", None) warn = False if "of...
https://github.com/pandas-dev/pandas/issues/1943
In [25]: df = pandas.DataFrame(np.random.randn(4,4), columns=list('AABC')) In [26]: df Out[26]: A A B C 0 -0.174905 0.332522 1.134984 -0.201270 1 1.730445 0.382556 -0.607761 1.221815 2 0.513049 0.196231 -1.746732 -0.252282 3 -0.297577 -1.000121 -0.090442 -2.129467 In [27]: df.ix[:,['A',...
Exception
def _generate(cls, start, end, periods, name, offset, tz=None, normalize=False): if com._count_not_none(start, end, periods) < 2: raise ValueError("Must specify two of start, end, or periods") _normalized = True if start is not None: start = Timestamp(start) if end is not None: ...
def _generate(cls, start, end, periods, name, offset, tz=None, normalize=False): if com._count_not_none(start, end, periods) < 2: raise ValueError("Must specify two of start, end, or periods") _normalized = True if start is not None: start = Timestamp(start) if end is not None: ...
https://github.com/pandas-dev/pandas/issues/1943
In [25]: df = pandas.DataFrame(np.random.randn(4,4), columns=list('AABC')) In [26]: df Out[26]: A A B C 0 -0.174905 0.332522 1.134984 -0.201270 1 1.730445 0.382556 -0.607761 1.221815 2 0.513049 0.196231 -1.746732 -0.252282 3 -0.297577 -1.000121 -0.090442 -2.129467 In [27]: df.ix[:,['A',...
Exception
def append(self, other): """ Append a collection of Index options together Parameters ---------- other : Index or list/tuple of indices Returns ------- appended : Index """ name = self.name to_concat = [self] if isinstance(other, (list, tuple)): to_concat = to_...
def append(self, other): """ Append a collection of Index options together Parameters ---------- other : Index or list/tuple of indices Returns ------- appended : Index """ from pandas.core.index import _ensure_compat_concat name = self.name to_concat = [self] if ...
https://github.com/pandas-dev/pandas/issues/1943
In [25]: df = pandas.DataFrame(np.random.randn(4,4), columns=list('AABC')) In [26]: df Out[26]: A A B C 0 -0.174905 0.332522 1.134984 -0.201270 1 1.730445 0.382556 -0.607761 1.221815 2 0.513049 0.196231 -1.746732 -0.252282 3 -0.297577 -1.000121 -0.090442 -2.129467 In [27]: df.ix[:,['A',...
Exception
def equals(self, other): """ Determines if two Index objects contain the same elements. """ if self is other: return True if not hasattr(other, "inferred_type") or other.inferred_type != "datetime64": if self.offset is not None: return False try: othe...
def equals(self, other): """ Determines if two Index objects contain the same elements. """ if self is other: return True if not hasattr(other, "inferred_type") or other.inferred_type != "datetime64": if self.offset is not None: return False try: othe...
https://github.com/pandas-dev/pandas/issues/1943
In [25]: df = pandas.DataFrame(np.random.randn(4,4), columns=list('AABC')) In [26]: df Out[26]: A A B C 0 -0.174905 0.332522 1.134984 -0.201270 1 1.730445 0.382556 -0.607761 1.221815 2 0.513049 0.196231 -1.746732 -0.252282 3 -0.297577 -1.000121 -0.090442 -2.129467 In [27]: df.ix[:,['A',...
Exception
def rollback(self, dt): """Roll provided date backward to next offset only if not on offset""" if type(dt) == date: dt = datetime(dt.year, dt.month, dt.day) if not self.onOffset(dt): dt = dt - self.__class__(1, **self.kwds) return dt
def rollback(self, someDate): """Roll provided date backward to next offset only if not on offset""" if not self.onOffset(someDate): someDate = someDate - self.__class__(1, **self.kwds) return someDate
https://github.com/pandas-dev/pandas/issues/1943
In [25]: df = pandas.DataFrame(np.random.randn(4,4), columns=list('AABC')) In [26]: df Out[26]: A A B C 0 -0.174905 0.332522 1.134984 -0.201270 1 1.730445 0.382556 -0.607761 1.221815 2 0.513049 0.196231 -1.746732 -0.252282 3 -0.297577 -1.000121 -0.090442 -2.129467 In [27]: df.ix[:,['A',...
Exception
def rollforward(self, dt): """Roll provided date forward to next offset only if not on offset""" if type(dt) == date: dt = datetime(dt.year, dt.month, dt.day) if not self.onOffset(dt): dt = dt + self.__class__(1, **self.kwds) return dt
def rollforward(self, dt): """Roll provided date forward to next offset only if not on offset""" if not self.onOffset(dt): dt = dt + self.__class__(1, **self.kwds) return dt
https://github.com/pandas-dev/pandas/issues/1943
In [25]: df = pandas.DataFrame(np.random.randn(4,4), columns=list('AABC')) In [26]: df Out[26]: A A B C 0 -0.174905 0.332522 1.134984 -0.201270 1 1.730445 0.382556 -0.607761 1.221815 2 0.513049 0.196231 -1.746732 -0.252282 3 -0.297577 -1.000121 -0.090442 -2.129467 In [27]: df.ix[:,['A',...
Exception
def onOffset(self, dt): # XXX, see #1395 if type(self) == DateOffset or isinstance(self, Tick): return True # Default (slow) method for determining if some date is a member of the # date range generated by this offset. Subclasses may have this # re-implemented in a nicer way. a = dt ...
def onOffset(self, dt): if type(self) == DateOffset: return True # Default (slow) method for determining if some date is a member of the # date range generated by this offset. Subclasses may have this # re-implemented in a nicer way. a = dt b = (dt + self) - self return a == b
https://github.com/pandas-dev/pandas/issues/1943
In [25]: df = pandas.DataFrame(np.random.randn(4,4), columns=list('AABC')) In [26]: df Out[26]: A A B C 0 -0.174905 0.332522 1.134984 -0.201270 1 1.730445 0.382556 -0.607761 1.221815 2 0.513049 0.196231 -1.746732 -0.252282 3 -0.297577 -1.000121 -0.090442 -2.129467 In [27]: df.ix[:,['A',...
Exception
def apply(self, other): if type(other) == date: other = datetime(other.year, other.month, other.day) if isinstance(other, (datetime, timedelta)): return other + self.delta elif isinstance(other, type(self)): return type(self)(self.n + other.n) else: # pragma: no cover r...
def apply(self, other): if isinstance(other, (datetime, timedelta)): return other + self.delta elif isinstance(other, type(self)): return type(self)(self.n + other.n)
https://github.com/pandas-dev/pandas/issues/1943
In [25]: df = pandas.DataFrame(np.random.randn(4,4), columns=list('AABC')) In [26]: df Out[26]: A A B C 0 -0.174905 0.332522 1.134984 -0.201270 1 1.730445 0.382556 -0.607761 1.221815 2 0.513049 0.196231 -1.746732 -0.252282 3 -0.297577 -1.000121 -0.090442 -2.129467 In [27]: df.ix[:,['A',...
Exception
def to_timestamp(self, freq=None, how="S"): """ Return the Timestamp at the start/end of the period Parameters ---------- freq : string or DateOffset, default frequency of PeriodIndex Target frequency how: str, default 'S' (start) 'S', 'E'. Can be aliased as case insensitive ...
def to_timestamp(self, freq=None, how="S"): """ Return the Timestamp at the start/end of the period Parameters ---------- freq : string or DateOffset, default frequency of PeriodIndex Target frequency how: str, default 'S' (start) 'S', 'E'. Can be aliased as case insensitive ...
https://github.com/pandas-dev/pandas/issues/1943
In [25]: df = pandas.DataFrame(np.random.randn(4,4), columns=list('AABC')) In [26]: df Out[26]: A A B C 0 -0.174905 0.332522 1.134984 -0.201270 1 1.730445 0.382556 -0.607761 1.221815 2 0.513049 0.196231 -1.746732 -0.252282 3 -0.297577 -1.000121 -0.090442 -2.129467 In [27]: df.ix[:,['A',...
Exception
def _make_plot(self): import matplotlib as mpl colors = self._get_colors() rects = [] labels = [] ax = self._get_ax(0) # self.axes[0] bar_f = self.bar_f pos_prior = neg_prior = np.zeros(len(self.data)) K = self.nseries for i, (label, y) in enumerate(self._iter_data()): ...
def _make_plot(self): import matplotlib as mpl colors = self._get_colors() rects = [] labels = [] ax = self._get_ax(0) # self.axes[0] bar_f = self.bar_f pos_prior = neg_prior = np.zeros(len(self.data)) K = self.nseries for i, (label, y) in enumerate(self._iter_data()): ...
https://github.com/pandas-dev/pandas/issues/3309
23:57 ~/code/pandas (master)$ nosetests pandas/tests/test_graphics.py ........F............................... ====================================================================== FAIL: test_bar_log (pandas.tests.test_graphics.TestDataFramePlots) ----------------------------------------------------------------------...
AssertionError
def _get_xticks(self, convert_period=False): index = self.data.index is_datetype = index.inferred_type in ("datetime", "date", "datetime64", "time") if self.use_index: if convert_period and isinstance(index, PeriodIndex): index = index.to_timestamp().order() x = index._mpl_r...
def _get_xticks(self, convert_period=False): index = self.data.index is_datetype = index.inferred_type in ("datetime", "date", "datetime64", "time") if self.use_index: if convert_period and isinstance(index, PeriodIndex): index = index.to_timestamp() x = index._mpl_repr() ...
https://github.com/pandas-dev/pandas/issues/2609
Exception in Tkinter callback Traceback (most recent call last): File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1413, in __call__ return self.func(*args) File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 498, in callit func(*args) File "/usr/lib/pymodules/python2.7/matplotlib/backends/backend_tkagg.py", line 254, in...
RuntimeError
def _nanmin(values, axis=None, skipna=True): mask = isnull(values) dtype = values.dtype if skipna and not issubclass(dtype.type, (np.integer, np.datetime64)): values = values.copy() np.putmask(values, mask, np.inf) if issubclass(dtype.type, np.datetime64): values = values.view...
def _nanmin(values, axis=None, skipna=True): mask = isnull(values) dtype = values.dtype if skipna and not issubclass(dtype.type, (np.integer, np.datetime64)): values = values.copy() np.putmask(values, mask, np.inf) if issubclass(dtype.type, np.datetime64): values = values.view...
https://github.com/pandas-dev/pandas/issues/2610
In [47]: all Out[47]: <class 'pandas.core.frame.DataFrame'> Int64Index: 974757 entries, 0 to 974756 Data columns: eid 974757 non-null values number 974757 non-null values a 972510 non-null values b 974757 non-null values c 92926...
ValueError
def _nanmax(values, axis=None, skipna=True): mask = isnull(values) dtype = values.dtype if skipna and not issubclass(dtype.type, (np.integer, np.datetime64)): values = values.copy() np.putmask(values, mask, -np.inf) if issubclass(dtype.type, np.datetime64): values = values.vie...
def _nanmax(values, axis=None, skipna=True): mask = isnull(values) dtype = values.dtype if skipna and not issubclass(dtype.type, (np.integer, np.datetime64)): values = values.copy() np.putmask(values, mask, -np.inf) if issubclass(dtype.type, np.datetime64): values = values.vie...
https://github.com/pandas-dev/pandas/issues/2610
In [47]: all Out[47]: <class 'pandas.core.frame.DataFrame'> Int64Index: 974757 entries, 0 to 974756 Data columns: eid 974757 non-null values number 974757 non-null values a 972510 non-null values b 974757 non-null values c 92926...
ValueError
def format(self, name=False, formatter=None): """ Render a string representation of the Index """ header = [] if name: header.append(str(self.name) if self.name is not None else "") return header + ["%s" % Period(x, freq=self.freq) for x in self]
def format(self, name=False): """ Render a string representation of the Index """ header = [] if name: header.append(str(self.name) if self.name is not None else "") return header + ["%s" % Period(x, freq=self.freq) for x in self]
https://github.com/pandas-dev/pandas/issues/2549
In [1]: import numpy as np In [2]: import pandas as pd In [3]: index = pd.PeriodIndex(['2011-1', '2011-2', '2011-3'], freq='M') In [4]: frame = pd.DataFrame(np.random.randn(3,4),index=index) In [5]: frame.to_string() --------------------------------------------------------------------------- TypeError ...
TypeError
def bootstrap_plot(series, fig=None, size=50, samples=500, **kwds): """Bootstrap plot. Parameters: ----------- series: Time series fig: matplotlib figure object, optional size: number of data points to consider during each sampling samples: number of times the bootstrap procedure is perform...
def bootstrap_plot(series, fig=None, size=50, samples=500, **kwds): """Bootstrap plot. Parameters: ----------- series: Time series fig: matplotlib figure object, optional size: number of data points to consider during each sampling samples: number of times the bootstrap procedure is perform...
https://github.com/pandas-dev/pandas/issues/2331
====================================================================== FAIL: test_quoting (pandas.io.tests.test_parsers.TestParsers) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/jtaylor/tmp/pandas-0.9.1/build/lib.linux-x86_64-3.3/pandas/io/tests/t...
AssertionError