Skip to content

ERR: Rolling().Apply() on Object-Series should raise internally caught errors #15085

Closed
@floriangeigl

Description

@floriangeigl
import pandas as pd
s = pd.Series([set([i]) for i in range(10)])
s.rolling(2).apply(lambda x: x[0] | x[1]) # just returns original series - lambda function gets never called)

.rolling().apply() on a object-series seems to do nothing. One can even write:

s.rolling(2).apply(lambda x: _non_existing_function_)

without getting an exception.

It would be great to get an exception if rolling().apply() can not be used with object-series or even better: A proper working rolling().apply() for object-series :)

The expected output from the rolling().apply() from above would be sth like:
NaN
{1,2}
{2,3}
{3,4}
...

or, as said before, at least an exception.

Output of pd.show_versions()

INSTALLED VERSIONS ------------------ commit: None python: 3.5.2.final.0 python-bits: 64 OS: Linux OS-release: 4.4.39-moby machine: x86_64 processor: byteorder: little LC_ALL: C.UTF-8 LANG: C.UTF-8 LOCALE: en_US.UTF-8

pandas: 0.19.2
nose: 1.3.7
pip: 9.0.1
setuptools: 27.2.0
Cython: 0.24.1
numpy: 1.11.1
scipy: 0.18.1
statsmodels: 0.6.1
xarray: 0.8.2
IPython: 5.1.0
sphinx: 1.4.6
patsy: 0.4.1
dateutil: 2.5.3
pytz: 2016.6.1
blosc: None
bottleneck: 1.1.0
tables: 3.2.3.1
numexpr: 2.6.1
matplotlib: 1.5.3
openpyxl: 2.3.2
xlrd: 1.0.0
xlwt: 1.1.2
xlsxwriter: 0.9.3
lxml: 3.6.4
bs4: 4.5.1
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 1.0.13
pymysql: None
psycopg2: 2.6.2 (dt dec pq3 ext lo64)
jinja2: 2.8
boto: 2.42.0
pandas_datareader: None

Metadata

Metadata

Assignees

No one assigned

    Labels

    Dtype ConversionsUnexpected or buggy dtype conversionsError ReportingIncorrect or improved errors from pandasReshapingConcat, Merge/Join, Stack/Unstack, Explode

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions