Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ElieGrinfeder opened this issue May 31, 2023 · 0 comments
Open

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

ElieGrinfeder opened this issue May 31, 2023 · 0 comments

Comments

@ElieGrinfeder
Copy link

ElieGrinfeder commented May 31, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant