An interval mapping data structure

Category: Python - Education

This structure is a kind of dictionary which allows you to map data intervals to values. You can then query the structure for a given point, and it returns the value associated to the interval which contains the point.Boundary values don't need to be an integer ; in the test unit a date-time object is used. the testThis class uses bisect to ensure a O(log2 n) insert and lookup time. The insert algorithm tries to do "the right thing" when overlapping intervals are inserted. As a general rule, an inserted interval overrides every other mapping which was defined. Date: 18 April, 2012


Mapping Data - Data Structure - Data Intervals - Mapping - Data - Structure

Homepage: http://code.activestate.com/

Developer: code.activestate.com

License: Freeware

Operating System: All

Add a Comment

all are required fields

     
What do you think of this resource?

Select Your Rate:

Votes:0

 

Related Scripts Download

This script implements the Union Find data structure and algorithm.

developer Developer: code.activestate.com
license License: Freeware
operating systems Operating System: All


This script is a pure python drop in replacement for collections.

developer Developer: code.activestate.com
license License: Freeware
operating systems Operating System: All


Quick and easy FIFO queue class is an easy First-In-First-Out queue class based on Python's List data structure.

developer Developer: code.activestate.com
license License: Freeware
operating systems Operating System: All


A ring buffer is a buffer with a fixed size.

developer Developer: code.activestate.com
license License: Freeware
operating systems Operating System: All


This data structure acts almost like a dictionary, with two modifications: First, D.

developer Developer: code.activestate.com
license License: Freeware
operating systems Operating System: All


The str() function in the standard library behaves in a slightly weird way when applied against lists: on each element of the list, the repr() is appended.

developer Developer: code.activestate.com
license License: Artistic License, GNU General Public License (GPL)
operating systems Operating System: Windows, Linux, Mac OS, BSD, Solaris


Generic Tree Data Structure for Ruby is a simple to use general purpose Tree data structure implementation in Ruby.

developer Developer: files.rubyforge.vm.bytemark.co.uk
license License: Freeware
operating systems Operating System: Windows, Linux, Mac OS, BSD, Solaris


If you want to implement stateful objects, which have a different set of behaviours according to what state they are in, this requirement can be achieved with the use of mix-ins.

developer Developer: code.activestate.com
license License: Freeware
operating systems Operating System: All


This script uses fact that any probability distributions can be sampled by computing the cumulative distribution, drawing a random number from 0 to 1, and finding the x-value where that number is attained on the cumulative distribution.

developer Developer: code.activestate.com
license License: Freeware
operating systems Operating System: All