Living-with-machines / zooniverse-analysis-workshop

Jupyter Notebooks for processing Zooniverse classification and subject files
3 stars 2 forks source link

Replace `.append` method with `.concat` method #7

Closed kallewesterling closed 2 years ago

kallewesterling commented 2 years ago

See the cell:

# TODO: This cell generates deprecation warning (append is deprecated, use pd.concat instead)

df_annotations = pd.DataFrame()

for index, row in df.iterrows():
    s = pd.Series(row.annotations, name=index)
    df_annotations = df_annotations.append(s)

Replace with:

df_annotations = pd.DataFrame()

for index, row in df.iterrows():
    s = pd.Series(row.annotations, name=index)
    df_annotations = pd.concat([df_annotations, s], axis=1)

df_annotations = df_annotations.T