Skip to content

generating an interval from a list of lists #24

Description

@kgeographer

I've got pairs of years that look like this
timespans = [[1200, 1400], [150, 230]]

and can't see how to generate a multi-component interval looking like this via iteration:
interval([150.0, 230.0], [1200.0, 1400.0])

I have tried several things, including these
k = interval(t for t in timespans)
k = interval(tuple(t) for t in timespans)
which return an "Invalid interval component" error

k = interval(interval(t) for t in timespans)
results in interval([150.0, 1400.0]), which is not multi-component and won't work for the operations I want

k=interval(timespans[0],timespans[1]) gets the right result, but I can't find a way to generate it from a list

can you help?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions