Skip to content

Conditional split/groupby #414

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
wesm opened this issue Nov 24, 2011 · 1 comment
Closed

Conditional split/groupby #414

wesm opened this issue Nov 24, 2011 · 1 comment

Comments

@wesm
Copy link
Member

wesm commented Nov 24, 2011

per Andreas Hilboll question on mailing list

Hi,

I have a DataFrame ``DF`` where in one column there's the time (in
hours, as float). I'm looking for an easy way of iterating over
subsets of ``DF`` which are defined by looking for time gaps of 45
minutes or more and using these gaps as seperator between the
different iterators.

As a first shot, I would do something like this::

  diff = np.diff(DF.time)
  idx = np.where(diff>.75)[0]
  DFs = []
  for i in idx:
     DFs.append(DF.ix[from:to]

But maybe there's a simpler solution?
@ghost
Copy link

ghost commented Nov 22, 2013

dupe #4059

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant