Skip to content

Commit

Permalink
BUGFIX: get_kuhn now thresholds on rmax, not iloc
Browse files Browse the repository at this point in the history
  • Loading branch information
brunobeltran committed Apr 19, 2019
1 parent 79c3b03 commit f1d5cc4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion nuc_chain/fluctuations.py
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,8 @@ def get_kuhn(df, thresh, rmax_col='rmax', r2_col='r2'):
"""Take a df with r2/rmax columns and a threshold (burn in length) in
number of monomers after which to fit adn do a linear fit to extract teh
kuhn length."""
ks = scipy.stats.linregress(df[rmax_col].iloc[thresh:], df[r2_col].iloc[thresh:])
ks = scipy.stats.linregress(df.loc[df[rmax_col] > thresh, rmax_col],
df.loc[df[rmax_col] > thresh, r2_col])
return ks

def get_kuhns_grouped(df, thresh, groups, rmax_col='rmax', r2_col='r2'):
Expand Down

0 comments on commit f1d5cc4

Please sign in to comment.