Skip to content

vector indexing #2

@delgadom

Description

@delgadom

it would be great if we could do something along the lines of:

>>> runs[[0, 1, 2]]
[{'rcp': 'historical',
  'model': 'obs',
  'year': 1950,
  'func': <function __main__.<lambda>(x, thresh)>,
  'thresholds': 32},
 {'rcp': 'historical',
  'model': 'obs',
  'year': 1950,
  'func': <function __main__.<lambda>(x, thresh)>,
  'thresholds': 90},
 {'rcp': 'historical',
  'model': 'obs',
  'year': 1950,
  'func': <function __main__.<lambda>(x, thresh)>,
  'thresholds': 95}]

it would be even cooler if we could use slices:

>>> runs[:3]
[{'rcp': 'historical',
  'model': 'obs',
  'year': 1950,
  'func': <function __main__.<lambda>(x, thresh)>,
  'thresholds': 32},
 {'rcp': 'historical',
  'model': 'obs',
  'year': 1950,
  'func': <function __main__.<lambda>(x, thresh)>,
  'thresholds': 90},
 {'rcp': 'historical',
  'model': 'obs',
  'year': 1950,
  'func': <function __main__.<lambda>(x, thresh)>,
  'thresholds': 95}]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions