Skip to content

Thousands of FutureWarnings with pandas 2.2.3 #32

@MatthewThe

Description

@MatthewThe

Using pandas 2.2.3, the tmt_processing script results in one warning per MS2 scan:

/usr/local/lib/python3.9/site-packages/simsi_transfer/tmt_processing.py:174: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas. Value '36440' has dtype incompatible with float32, please explicitly cast to a compatible dtype first.
  scanseries["scanID"] = re.search(

This seems to be a result of scanseries explicitly using float32 but subsequently being assigned an int value:

scanseries = pd.Series(index=dfcol, dtype="float32")
if extraction_level == 2:
scanseries["scanID"] = int(re.search(r"scan=(\d+)", item["id"])[1])
else:
# supposed to find parent MS2 spectrum for MS3 by looking into precursorList/precursor/spectrumRef
scanseries["scanID"] = int(re.search(
r"scan=(\d+)", item["precursorList"]["precursor"][0]["spectrumRef"]
)[1])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions