Skip to content

BUG: Incorrect formatting of empty frozenset in object Series #66192

Description

@Johnhi19

Pandas version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

import pandas as pd

s = pd.Series([frozenset()])
print(s)

print(repr(s))

Issue Description

I get the following output:

0    frozenset({})
dtype: object
0    frozenset({})
dtype: object

Expected Behavior

I would expect to get the following output:

0    frozenset()
dtype: object
0    frozenset()
dtype: object

As empty frozensets are represented as fozenset() I would expect that the above example also returns it in this format.

Installed Versions

Details

INSTALLED VERSIONS

commit : a7bd1ae
python : 3.11.15
python-bits : 64
OS : Linux
OS-release : 6.1.0-37-amd64
Version : #1 SMP PREEMPT_DYNAMIC Debian 6.1.140-1 (2025-05-22)
machine : x86_64
processor :
byteorder : little
LC_ALL : None
LANG : C.UTF-8
LOCALE : en_US.UTF-8

pandas : 3.1.0.dev0+1209.ga7bd1ae0bd
numpy : 2.4.6
dateutil : 2.9.0.post0
pip : 24.0
Cython : 3.2.8
sphinx : 9.0.4
IPython : 9.15.0
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : 4.15.0
bottleneck : 1.6.0
fastparquet : 2026.5.0
fsspec : 2026.6.0
html5lib : 1.1
hypothesis : 6.156.1
gcsfs : 2026.7.0
jinja2 : 3.1.6
lxml.etree : 6.1.1
matplotlib : 3.11.0
numba : 0.66.0
numexpr : 2.14.1
odfpy : None
openpyxl : 3.1.5
psycopg2 : 2.9.12
pymysql : 2.2.8
pyarrow : 23.0.1
pyiceberg : 0.11.1
pyreadstat : 1.3.5
pytest : 9.1.1
python-calamine : None
pytz : 2026.2
pyxlsb : 1.0.10
s3fs : 2026.6.0
scipy : 1.17.1
sqlalchemy : 2.0.51
tables : 3.11.1
tabulate : 0.10.0
xarray : 2026.4.0
xlrd : 2.0.2
xlsxwriter : 3.2.9
zstandard : 0.25.0
qtpy : None
pyqt5 : None

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugNeeds TriageIssue that has not been reviewed by a pandas team member

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions