Skip to content

Pandas future warning #560

@thomas-reimonn

Description

@thomas-reimonn

When running cooltools with python3.12 and updated pandas, I get:

/Users/thomas/alabtools/.venv/lib/python3.11/site-packages/cooltools/api/saddle.py:446: FutureWarning: Series.getitem treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use ser.iloc[pos]
type(digitized_track.dtypes[3])
/Users/thomas/alabtools/.venv/lib/python3.11/site-packages/cooltools/api/saddle.py:92: RuntimeWarning: invalid value encountered in divide
return obs_mat / exp_mat

It's probably worth add a _safe_divide and changing this for future pandas compatability.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    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