Skip to content

'DataFrame' object has no attribute 'append' #7

@ElieGrinfeder

Description

@ElieGrinfeder

The function dataset.grab_audio_to_df() and segmentation.multicpu_extract_rois() uses the attribute 'append'. However, this attribute has been deprecated since pandas 2.0. New version should use 'concat' for the package to be compatible with more recent installations.

Here is a working fix.

In dataset.grab_audio_to_df(), replace line 349 with :

df_line = pd.DataFrame({      'fullfilename':file,
                                      'filename'    :Path(file).parts[-1],
                                      'categories'  :categories,
                                      'id'          :iden}
                               , index=[0])
df_dataset = pd.concat([df_dataset, df_line], ignore_index=True)

In segmentation.multicpu_extract_rois(), replace line 490 with :
df_rois = pd. concat([df_rois,df_rois_temp])

line 496 :
df_rois_sorted = pd. concat([df_rois_sorted, df_rois[df_rois["categories"] == categories].sort_index()] )

Similar modifications also need to be applied to segmentaiton.py

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