Skip to content

Commit

Permalink
fix: fixing incorrect filtering of dataframe
Browse files Browse the repository at this point in the history
  • Loading branch information
Rowansiv authored Jun 22, 2022
1 parent e70a3f5 commit e6b5d23
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/emgdecompy/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ def muap_plot(
return plot


def pulse_plot(pt, c_sq_mean, mu_index=None, sel_type="single"):
def pulse_plot(pt, c_sq_mean, mu_index, sel_type="single"):
"""
Plot firings for a given motor unit.
Expand All @@ -444,9 +444,9 @@ def pulse_plot(pt, c_sq_mean, mu_index=None, sel_type="single"):
mu_count = pt.shape[0]

motor_df = pd.DataFrame(columns=["Pulse", "Strength", "Motor Unit", "MS", "Hz"])
for i in range(1, mu_count + 1):
for i in range(0, mu_count ):
# PT for MU of interest:
pt_selected = pt.squeeze()[i - 1].squeeze()
pt_selected = pt.squeeze()[i].squeeze()
strength_selected = c_sq_mean[pt_selected]
hertz = 1 / np.diff(pt_selected)
hertz_list = hertz.tolist()
Expand All @@ -464,7 +464,6 @@ def pulse_plot(pt, c_sq_mean, mu_index=None, sel_type="single"):
motor_df_i = pd.DataFrame(pulses_i)
motor_df = pd.concat([motor_df, motor_df_i])

if mu_index:
motor_df = motor_df.loc[motor_df["Motor Unit"] == mu_index]
# brush = alt.selection_interval(encodings=['x'], name='brush') # Don't know if we will use this

Expand Down

0 comments on commit e6b5d23

Please sign in to comment.