question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

A problem with slicing in subsampling

See original GitHub issue

Hi alchemlyb developers, Thank you all for the development of this package. I was using alchemlyb to analyze some output files from the simulation performed by GROMACS. When using the function equilibrium_detection with the input parameters df and series being the whole u_nk matrix extracted from a *dhdl.xvg file (by the function extract_u_nk) and the first column of u_nk (which is u_nk[(0.0, 0.0, 0.0, 0.0)]), I got the following error:

KeyError: Index(['time'], dtype='object')

Tracing back the error, I found that this error indicated that there was no time index in the series u_nk[(0.0, 0.0, 0.0, 0.0)] . However, series.index in this case did return time as one of the names of the indices. I am not sure if this is an issue of data types. I tried turning the data type of u_nk[(0.0, 0.0, 0.0, 0.0)] from Series into DataFrame, but same error occurred. Here I reproduced the error in a jupyter notebook, in which I also added some comments and explanations of the problem(alchemlyb_issue.zip).

To my understanding, the input parameter df of the subsampling methods should be the matrix/DataFrame extracted from the xvg file, while series could be any time series/column of df. I’m not sure if this understanding is correct, but it might be worthy to add more detailed explanations of these two parameters in the documentation.

Thanks a lot!

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
dotsdlcommented, Aug 25, 2020

Cool, thank you for this feedback @wehs7661! This helps me to prioritize effort appropriately. I’ll proceed with the refactor then.

0reactions
wehs7661commented, Aug 24, 2020

Hi @dotsdl, no worries at all, and thanks for following up! So I just tried first upgrading my version of pandas (to version 1.11.0) and using alchemlyb on the master branch instead, but I still got the same error. (I was originally using the one on the branch refactor-subsampling and it worked for me.)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ramsey-Subsampling-article.pdf - CLU-IN
There are two problems with subsam- pling all materials. One is collecting enough sample mass to represent all the particles. The other is...
Read more >
Subsample a 3D volume - Development - 3D Slicer Community
As a follow up to this question, I have an issue with the visualization of the volume when the volume spacing is higher...
Read more >
Time for a rethink: time sub‐sampling methods in disparity ...
We test the time-slicing method on four example datasets and compare its performance in common disparity-through-time analyses. We find that ...
Read more >
Effect of subsampling in slice direction. SE of mean (%) was plotted ...
The excess of visceral adipose tissue is associated with hypertension, prothrombotic and pro-inflammatory states. Our aim was to find a possible association ...
Read more >
Slicing a sparse scipy matrix to subsample for every 10th row ...
However, when I run this and and query the shape of connections_sampled, I get the original dimensions of connections instead of dimensions that ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found