Gnm.Range¶
Fields¶
Name |
Type |
Access |
Description |
---|---|---|---|
end |
r/w |
||
start |
r/w |
Methods¶
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- class Gnm.Range¶
- classmethod adtest(xs, n, p, statistics)¶
- classmethod concatenate(data, user)¶
- classmethod correl_pop(xs, ys, n, res)¶
- classmethod covar_est(xs, ys, n, res)¶
- classmethod covar_pop(xs, ys, n, res)¶
- classmethod geometric_mean(xs, n, res)¶
- classmethod harmonic_mean(xs, n, res)¶
- classmethod kurtosis_m3_est(xs, n, res)¶
- classmethod kurtosis_m3_pop(xs, n, res)¶
- classmethod list_destroy(ranges)¶
- Parameters:
ranges ([
Gnm.Value
]) – a list ofGOffice.value
ranges to destroy.
Destroys a list of ranges returned from parse_cell_range_list. Note: the element type here is
Gnm.Value
, notGnm.Range
.
- classmethod multinomial(xs, n, res)¶
- classmethod rsq_pop(xs, ys, n, res)¶
- classmethod simplify(arr)¶
- Parameters:
arr ([
Gnm.Range
]) – array of ranges to simplify- Returns:
array of ranges to simplify
- Return type:
arr: [
Gnm.Range
]
Simplifies the array of ranges by merging small ranges into larger ones.
- classmethod stddev_est(xs, n, res)¶
- classmethod stddev_pop(xs, n, res)¶
- clip_to_finite(sheet)¶
- Parameters:
sheet (
Gnm.Sheet
) – the sheet in which self lives
Clip the range to the area of the sheet with content. if the range reaches the edge
The idea here is that users may select a whole column or
Gnm.row
when they really are only concerned with the extent of the sheet. On the otehr hand, if users select any smaller region they probably intend to select just that.WARNING THIS IS EXPENSIVE!
- compare(b)¶
- Parameters:
b (
Gnm.Range
) – second range- Returns:
a
GOffice.value
that is negative if range self comes before range b; zero if the two ranges are equal; positive if range self comes after range b. The order imposed is lexicographical by startingGnm.row
, then column, then endingGnm.row
, then column. In other words, the order is A1, B1, A2, B2.- Return type:
- ensure_sanity(sheet)¶
- Parameters:
sheet (
Gnm.Sheet
) – the sheet in which self lives
Silently clip a range to ensure that it does not contain areas outside the valid bounds. Does NOT fix inverted ranges.
- fragment(b)¶
- Parameters:
- Returns:
A list of fragmented ranges or at minimum simply self and b.
- Return type:
Fragments the ranges into totally non-overlapping regions,
- init(start_col, start_row, end_col, end_row)¶
- Parameters:
- Returns:
self
- Return type:
Updates self to start at (start_col,`start_row`) and end at (end_col,`end_row`).
- init_cellpos(pos)¶
- Parameters:
pos (
Gnm.CellPos
) – AGnm.CellPos
- Returns:
self
- Return type:
Updates self to be the singleton range of pos
- init_cellpos_size(start, cols, rows)¶
- Parameters:
start (
Gnm.CellPos
) – AGnm.CellPos
for the upper left corner of the desired rangecols (
int
) – number of columnsrows (
int
) – number of rows
- Returns:
self
- Return type:
Updates self to start at start and spanning cols columns and rows rows.
- init_cols(sheet, start_col, end_col)¶
- Parameters:
- Returns:
self
- Return type:
Updates self to span full columns start_col through end_col completely.
- init_full_sheet(sheet)¶
-
Updates self to
GOffice.fill
sheet in its entirety.
- init_rangeref(rr)¶
- Parameters:
rr (
Gnm.RangeRef
) –Gnm.RangeRef
- Returns:
self
- Return type:
Updates self to be the same as the range part of rr.
- init_rows(sheet, start_row, end_row)¶
- Parameters:
- Returns:
self
- Return type:
Updates self to span full rows start_row through end_row completely.
- init_value(v)¶
-
Updates self to be the same as the cell range of v.
- intersection(a, b)¶
- Parameters:
- Returns:
- Return type:
This computes the intersection of two ranges; on a Venn diagram this would be A (upside down U) B. If the ranges do not intersect, false is returned an the values of self are unpredictable.
NB. totally commutative
- is_full(sheet, horiz)¶
- Parameters:
- Returns:
- Return type:
This determines whether self completely spans a sheet in the dimension specified by horiz.
- normalize()¶
Ensures that start <= end for rows and cols.
- parse(text, ss)¶
- Parameters:
text (
str
) – text to parsess (
Gnm.SheetSize
) –Gnm.SheetSize
describing the size of the sheet in which self lives.
- Returns:
True
on success.- Return type:
Parse a simple range (no abs/rel refs, no sheet refs) Store the result in self.
- split_ranges(soft)¶
- Parameters:
soft (
Gnm.Range
) – The region that is split- Returns:
A list of fragments.
- Return type:
Splits soft into several chunks, and returns the still overlapping remainder of soft as the first list item (the central region in the pathological case).
- translate(sheet, col_offset, row_offset)¶
- Parameters:
- Returns:
True
if the range is no longer valid.- Return type:
Translate the range and return
True
if it is invalidated.
- transpose(sheet, origin)¶
- Parameters:
sheet (
Gnm.Sheet
) – the sheet in which self livesorigin (
Gnm.CellPos
) – The box to transpose inside
- Returns:
whether we clipped the range.
- Return type:
Effectively mirrors the ranges in ‘boundary’ around a leading diagonal projected from offset.