Skip to content

ENH: frozensets are shown in parentheses (like tuples) #60690

Open
@wjandrea

Description

Pandas version checks

  • I have checked that this issue has not already been reported.
    • Query: is:issue in:title frozenset
  • 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

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

Issue Description

0    (1)
dtype: object

Expected Behavior

The same as s.map(repr):

0    frozenset({1})
dtype: object

Or if you insist on an abbreviated option, maybe something like this:

0    f{1}
dtype: object

Installed Versions

INSTALLED VERSIONS
------------------
commit                : 3aba767f3ac4507185d911ed120a49969cdee63d
python                : 3.12.8
python-bits           : 64
OS                    : Linux
OS-release            : 5.4.0-204-generic
Version               : #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024
machine               : x86_64
processor             : x86_64
byteorder             : little
LC_ALL                : None
LANG                  : fr_CA.UTF-8
LOCALE                : fr_CA.UTF-8

pandas                : 3.0.0.dev0+1815.g3aba767f3a
numpy                 : 2.1.0.dev0+git20240403.e59c074
dateutil              : 2.9.0.post0
pip                   : 24.3.1
Cython                : None
sphinx                : None
IPython               : 8.22.2
adbc-driver-postgresql: None
adbc-driver-sqlite    : None
bs4                   : None
blosc                 : None
bottleneck            : None
fastparquet           : None
fsspec                : None
html5lib              : None
hypothesis            : None
gcsfs                 : None
jinja2                : None
lxml.etree            : None
matplotlib            : None
numba                 : None
numexpr               : None
odfpy                 : None
openpyxl              : None
psycopg2              : None
pymysql               : None
pyarrow               : None
pyreadstat            : None
pytest                : None
python-calamine       : None
pytz                  : 2024.1
pyxlsb                : None
s3fs                  : None
scipy                 : None
sqlalchemy            : None
tables                : None
tabulate              : None
xarray                : None
xlrd                  : None
xlsxwriter            : None
zstandard             : None
tzdata                : 2024.1
qtpy                  : None
pyqt5                 : None

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions