Skip to content

Commit

Permalink
Fix problem with info() #316
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimpoutaraud committed Jan 8, 2024
1 parent 204ee25 commit aa67476
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions musicalgestures/_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,12 @@ def mg_info(self, type=None, autoshow=True, overwrite=False):
# Create a pandas dataframe
df = pd.DataFrame.from_dict(frame)

# Rename codec type column
df["codec_type"] = ['video', 'audio', 'format']
column = df.pop('codec_type')
df.insert(0, column.name, column)
df.insert(0, 'codec_type', df.pop('codec_type')) # move codec type column
df.pop('index') # remove index column
df = df[df.codec_type.notna()] # remove rows with nan values in codec_type column

if type is not None:
return df[df["codec_type"] == type]
return df[df.codec_type == type]
else:
return df

Expand Down

0 comments on commit aa67476

Please sign in to comment.