Skip to content

index out of bounds in correlation plot #6

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

Closed
sdvillal opened this issue Oct 16, 2014 · 1 comment
Closed

index out of bounds in correlation plot #6

sdvillal opened this issue Oct 16, 2014 · 1 comment

Comments

@sdvillal
Copy link
Contributor

We get an index-out-of-bounds with this (and others) Etienne experiments

./translation-analysis.py --uuid f8fd79b0548111e4b9debcee7bdac37c --zfilt trim --zfilt-max 0.365 --zfilt-min 0.05 --rfilt trim --reindex --arena flycube --lenfilt 1 --cached --out /tmp
Traceback (most recent call last):
  File "./translation-analysis.py", line 95, in <module>
    curve.plot_correlation_analysis(args, combine, correlations, correlation_options)
  File "/home/santi/Proyectos/imp/software/strawlab_freeflight_experiments/src/analysislib/curvature.py", line 369, in plot_correlation_analysis
    max_latencies_shift[_current_condition] = (latencies[ccef_m.argmax()], ccef_m.max())
IndexError: list index out of range

This seems related but different to #4

@sdvillal
Copy link
Contributor Author

This and #4 are both related to the change of argmax semantics between pandas 0.12 and 0.13. Important to point out the new semantics of argmax in pandas:

  • It is a synonym of idxmax and therefore returns a value from the index, instead of a location
    • We can get the location using either s.index.get_loc(s.idxmax()) or np.argmax(s)
  • It returns nan if the max does not exist (= we have a series with all missing values or values that do not have a partial order).

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