BUG: TypeError: GroupBy.first() got an unexpected keyword argument 'engine' · Issue #55520 · pandas-dev/pandas (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

@AliSayyah

Description

@AliSayyah

Pandas version checks

Reproducible Example

import pandas as pd import numpy as np pd.set_option("compute.use_numba", True)

num_rows = 10 dates = pd.date_range(start='2023-10-01', periods=num_rows, freq='D') open_prices = np.random.uniform(100, 200, num_rows).round(2)

Create a DataFrame

data = { 'open': open_prices, 'date': dates }

df = pd.DataFrame(data)

df = df.groupby(by='date', as_index=False, sort=True).agg({ 'open': 'first' })

Issue Description

this returns an error: TypeError: GroupBy.first() got an unexpected keyword argument 'engine'

Expected Behavior

don't pass the engine argument to the first method if it isn't supported.

Installed Versions

INSTALLED VERSIONS

commit : e86ed37
python : 3.11.5.final.0
python-bits : 64
OS : Linux
OS-release : 6.5.4-76060504-generic
Version : #202309191142169599894322.04~070916d SMP PREEMPT_DYNAMIC Fri S
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 2.1.1
numpy : 1.25.2
pytz : 2023.3.post1
dateutil : 2.8.2
setuptools : 68.2.2
pip : 23.2.1
Cython : 3.0.3
pytest : 7.4.2
hypothesis : None
sphinx : None
blosc : 1.11.1
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 3.1.2
IPython : None
pandas_datareader : None
bs4 : 4.12.2
bottleneck : 1.3.7
dataframe-api-compat: None
fastparquet : None
fsspec : None
gcsfs : None
matplotlib : 3.8.0
numba : 0.58.0
numexpr : 2.8.7
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : 13.0.0
pyreadstat : None
pyxlsb : None
s3fs : None
scipy : 1.11.3
sqlalchemy : 2.0.21
tables : 3.8.0
tabulate : 0.9.0
xarray : None
xlrd : None
zstandard : None
tzdata : 2023.3
qtpy : None
pyqt5 : None