API Reference

Axis

Axis(labels[, name])

Represents an axis.

Exploring

Axis.name

Name of the axis. None in the case of an anonymous axis.

Axis.labels

Labels of the axis.

Axis.labels_summary

Short representation of the labels.

Axis.dtype

Data type for the axis labels.

Copying

Axis.copy(self)

Returns a copy of the axis.

Searching

Axis.index(self, key)

Translates a label key to its numerical index counterpart.

Axis.containing(self, substring)

Returns a group with all the labels containing the specified substring.

Axis.startingwith(self, prefix)

Returns a group with the labels starting with the specified string.

Axis.endingwith(self, suffix)

Returns a group with the labels ending with the specified string.

Axis.matching(self[, deprecated, pattern, regex])

Returns a group with all the labels matching the specified pattern or regular expression.

Modifying/Selecting

Axis.__getitem__(self, key)

Returns a group (list or unique element) of label(s) usable in .sum or .filter

Axis.i

Allows to define a subset using positions along the axis instead of labels.

Axis.by(self, length[, step, template])

Split axis into several groups of specified length.

Axis.rename(self, name)

Renames the axis.

Axis.subaxis(self, key[, name])

Returns an axis for a sub-array.

Axis.extend(self, labels)

Append new labels to an axis or increase its length in case of wildcard axis.

Axis.insert(self, new_labels[, before, after])

Return a new axis with new_labels inserted before before or after after.

Axis.replace(self, old[, new])

Returns a new axis with some labels replaced.

Axis.apply(self, func)

Returns a new axis with the labels transformed by func.

Axis.union(self, other)

Returns axis with the union of this axis labels and other labels.

Axis.intersection(self, other)

Returns axis with the (set) intersection of this axis labels and other labels.

Axis.difference(self, other)

Returns axis with the (set) difference of this axis labels and other labels.

Axis.align(self, other[, join])

Align axis with other object using specified join method.

Axis.split(self[, sep, names, regex, …])

Split axis and returns a list of Axis.

Axis.ignore_labels(self)

Returns a wildcard axis with the same name and length than this axis.

Testing

Axis.iscompatible(self, other)

Checks if self is compatible with another axis.

Axis.equals(self, other)

Checks if self is equal to another axis.

Save

Axis.to_hdf(self, filepath[, key])

Writes axis to a HDF file.

Group

IGroup

IGroup(key[, name, axis])

Index Group.

IGroup.named(self, name)

Returns group with a different name.

IGroup.with_axis(self, axis)

Returns group with a different axis.

IGroup.by(self, length[, step, template])

Split group into several groups of specified length.

IGroup.equals(self, other)

Checks if this group is equal to another group.

IGroup.translate(self[, bound, stop])

compute position(s) of group

IGroup.union(self, other)

Returns (set) union of this label group and other.

IGroup.intersection(self, other)

Returns (set) intersection of this label group and other.

IGroup.difference(self, other)

Returns (set) difference of this label group and other.

IGroup.containing(self, substring)

Returns a group with all the labels containing the specified substring.

IGroup.startingwith(self, prefix)

Returns a group with the labels starting with the specified string.

IGroup.endingwith(self, suffix)

Returns a group with the labels ending with the specified string.

IGroup.matching(self[, deprecated, pattern, …])

Returns a group with all the labels matching the specified pattern or regular expression.

IGroup.to_hdf(self, filepath[, key, axis_key])

Writes group to a HDF file.

LGroup

LGroup(key[, name, axis])

Label group.

LGroup.named(self, name)

Returns group with a different name.

LGroup.with_axis(self, axis)

Returns group with a different axis.

LGroup.by(self, length[, step, template])

Split group into several groups of specified length.

LGroup.equals(self, other)

Checks if this group is equal to another group.

LGroup.translate(self[, bound, stop])

compute position(s) of group

LGroup.union(self, other)

Returns (set) union of this label group and other.

LGroup.intersection(self, other)

Returns (set) intersection of this label group and other.

LGroup.difference(self, other)

Returns (set) difference of this label group and other.

LGroup.containing(self, substring)

Returns a group with all the labels containing the specified substring.

LGroup.startingwith(self, prefix)

Returns a group with the labels starting with the specified string.

LGroup.endingwith(self, suffix)

Returns a group with the labels ending with the specified string.

LGroup.matching(self[, deprecated, pattern, …])

Returns a group with all the labels matching the specified pattern or regular expression.

LGroup.to_hdf(self, filepath[, key, axis_key])

Writes group to a HDF file.

LSet

LSet(key[, name, axis])

Label set.

AxisCollection

AxisCollection([axes])

AxisCollection.names

Returns the list of (raw) names of the axes.

AxisCollection.display_names

Returns the list of (display) names of the axes.

AxisCollection.labels

Returns the list of labels of the axes.

AxisCollection.shape

Returns the shape of the collection.

AxisCollection.size

Returns the size of the collection, i.e.

AxisCollection.info

Describes the collection (shape and labels for each axis).

AxisCollection.copy(self)

Returns a copy.

Searching

AxisCollection.keys(self)

Returns list of all axis names.

AxisCollection.index(self, axis[, compatible])

Returns the index of axis.

AxisCollection.axis_id(self, axis)

Returns the id of an axis.

AxisCollection.ids

Returns the list of ids of the axes.

AxisCollection.iter_labels(self[, axes, …])

Returns a view of the axes labels.

Modifying/Selecting

AxisCollection.get(self, key[, default, name])

Returns axis corresponding to key.

AxisCollection.get_by_pos(self, key, i)

Returns axis corresponding to a key, or to position i if the key has no name and key object not found.

AxisCollection.get_all(self, key)

Returns all axes from key if present and length 1 wildcard axes otherwise.

AxisCollection.pop(self[, axis])

Removes and returns an axis.

AxisCollection.append(self, axis)

Appends axis at the end of the collection.

AxisCollection.extend(self, axes[, …])

Extends the collection by appending the axes from axes.

AxisCollection.insert(self, index, axis)

Inserts axis before index.

AxisCollection.rename(self[, renames, to])

Renames axes of the collection.

AxisCollection.replace(self[, …])

Replace one, several or all axes of the collection.

AxisCollection.set_labels(self[, axis, …])

Replaces the labels of one or several axes.

AxisCollection.without(self, axes)

Returns a new collection without some axes.

AxisCollection.combine_axes(self[, axes, …])

Combine several axes into one.

AxisCollection.split_axes(self[, axes, sep, …])

Split axes and returns a new collection

AxisCollection.align(self, other[, join, axes])

Align this axis collection with another.

Testing

AxisCollection.isaxis(self, value)

Tests if input is an Axis object or the name of an axis contained in self.

AxisCollection.check_compatible(self, axes)

Checks if axes passed as argument are compatible with those contained in the collection.

LArray

Overview

LArray(data[, axes, title, meta, dtype])

A LArray object represents a multidimensional, homogeneous array of fixed-size items with labeled axes.

Array Creation Functions

sequence(axis[, initial, inc, mult, func, …])

Creates an array by sequentially applying modifications to the array along axis.

ndtest(shape_or_axes[, start, label_start, …])

Returns test array with given shape.

zeros(axes[, title, dtype, order, meta])

Returns an array with the specified axes and filled with zeros.

zeros_like(array[, title, dtype, order, meta])

Returns an array with the same axes as array and filled with zeros.

ones(axes[, title, dtype, order, meta])

Returns an array with the specified axes and filled with ones.

ones_like(array[, title, dtype, order, meta])

Returns an array with the same axes as array and filled with ones.

empty(axes[, title, dtype, order, meta])

Returns an array with the specified axes and uninitialized (arbitrary) data.

empty_like(array[, title, dtype, order, meta])

Returns an array with the same axes as array and uninitialized (arbitrary) data.

full(axes, fill_value[, title, dtype, …])

Returns an array with the specified axes and filled with fill_value.

full_like(array, fill_value[, title, dtype, …])

Returns an array with the same axes and type as input array and filled with fill_value.

Copying

LArray.copy(self)

Returns a copy of the array.

LArray.astype(dtype[, order, casting, …])

Copy of the array, cast to a specified type.

Inspecting

LArray.data

Data of the array (Numpy ndarray)

LArray.axes

Axes of the array (AxisCollection)

LArray.title

Title of the array (str)

LArray.info

Describes a LArray (metadata + shape and labels for each axis).

LArray.shape

Returns the shape of the array as a tuple.

LArray.ndim

Returns the number of dimensions of the array.

LArray.dtype

Returns the type of the data of the array.

LArray.size

Returns the number of elements in array.

LArray.nbytes

Returns the number of bytes used to store the array in memory.

LArray.memory_used

Returns the memory consumed by the array in human readable form.

Modifying/Selecting

LArray.i

Allows selection of a subset using indices of labels.

LArray.points

Allows selection of arbitrary items in the array based on their N-dimensional label index.

LArray.ipoints

Allows selection of arbitrary items in the array based on their N-dimensional index.

LArray.iflat

Access the array by index as if it was flat (one dimensional) and all its axes were combined.

LArray.set(self, value, \*\*kwargs)

Sets a subset of array to value.

LArray.drop(self[, labels])

Return array without some labels or indices along an axis.

LArray.ignore_labels(self[, axes])

Ignore labels from axes (replace those axes by “wildcard” axes).

LArray.filter(self[, collapse])

Filters the array along the axes given as keyword arguments.

LArray.apply(self, transform, \*args, \*\*kwargs)

Apply a transformation function to array elements.

LArray.apply_map(self, mapping[, dtype])

Apply a transformation mapping to array elements.

Changing Axes or Labels

LArray.set_axes(self[, axes_to_replace, …])

Replace one, several or all axes of the array.

LArray.rename(self[, renames, to, inplace])

Renames axes of the array.

LArray.set_labels(self[, axis, labels, inplace])

Replaces the labels of one or several axes of the array.

LArray.combine_axes(self[, axes, sep, wildcard])

Combine several axes into one.

LArray.split_axes(self[, axes, sep, names, …])

Split axes and returns a new array

LArray.reverse(self[, axes])

Reverse axes of an array

Aggregation Functions

LArray.sum(*axes_and_groups[, dtype, out, …])

Computes the sum of array elements along given axes/groups.

LArray.sum_by(*axes_and_groups[, dtype, …])

Computes the sum of array elements for the given axes/groups.

LArray.prod(*axes_and_groups[, dtype, out, …])

Computes the product of array elements along given axes/groups.

LArray.prod_by(*axes_and_groups[, dtype, …])

Computes the product of array elements for the given axes/groups.

LArray.cumsum(self[, axis])

Returns the cumulative sum of array elements along an axis.

LArray.cumprod(self[, axis])

Returns the cumulative product of array elements.

LArray.mean(*axes_and_groups[, dtype, out, …])

Computes the arithmetic mean.

LArray.mean_by(*axes_and_groups[, dtype, …])

Computes the arithmetic mean.

LArray.median(*axes_and_groups[, out, …])

Computes the arithmetic median.

LArray.median_by(*axes_and_groups[, out, …])

Computes the arithmetic median.

LArray.var(*axes_and_groups[, dtype, ddof, …])

Computes the unbiased variance.

LArray.var_by(*axes_and_groups[, dtype, …])

Computes the unbiased variance.

LArray.std(*axes_and_groups[, dtype, ddof, …])

Computes the sample standard deviation.

LArray.std_by(*axes_and_groups[, dtype, …])

Computes the sample standard deviation.

LArray.percentile(q, *axes_and_groups[, …])

Computes the qth percentile of the data along the specified axis.

LArray.percentile_by(q, *axes_and_groups[, …])

Computes the qth percentile of the data for the specified axis.

LArray.ptp(*axes_and_groups[, out])

Returns the range of values (maximum - minimum).

LArray.with_total(*args[, op, label])

Add aggregated values (sum by default) along each axis.

LArray.percent(self, \*axes)

Returns an array with values given as percent of the total of all values along given axes.

LArray.ratio(self, \*axes)

Returns an array with all values divided by the sum of values along given axes.

LArray.rationot0(self, \*axes)

Returns a LArray with values array / array.sum(axes) where the sum is not 0, 0 otherwise.

LArray.growth_rate(self[, axis, d, label])

Calculates the growth along a given axis.

LArray.describe(self, \*args, \*\*kwargs)

Descriptive summary statistics, excluding NaN values.

LArray.describe_by(self, \*args, \*\*kwargs)

Descriptive summary statistics, excluding NaN values, along axes or for groups.

Sorting

LArray.sort_axes(self[, axes, ascending])

Sorts axes of the array.

LArray.sort_values(self[, key, axis, ascending])

Sorts values of the array.

LArray.labelsofsorted(self[, axis, …])

Returns the labels that would sort this array.

LArray.indicesofsorted(self[, axis, …])

Returns the indices that would sort this array.

Reshaping/Extending/Reordering

LArray.reshape(self, target_axes)

Given a list of new axes, changes the shape of the array.

LArray.reshape_like(self, target)

Same as reshape but with an array as input.

LArray.compact(self)

Detects and removes “useless” axes (ie axes for which values are constant over the whole axis)

LArray.reindex(self[, axes_to_reindex, …])

Reorder and/or add new labels in axes.

LArray.transpose(self, \*args)

Reorder axes.

LArray.expand(self[, target_axes, out, readonly])

Expands array to target_axes.

LArray.prepend(self, axis, value[, label])

Adds an array before self along an axis.

LArray.append(self, axis, value[, label])

Adds an array to self along an axis.

LArray.extend(self, axis, other)

Adds an array to self along an axis.

LArray.insert(self, value[, before, after, …])

Inserts value in array along an axis.

LArray.broadcast_with(self, target)

Returns an array that is (NumPy) broadcastable with target.

LArray.align(self, other[, join, …])

Align two arrays on their axes with the specified join method.

Testing/Searching

LArray.equals(self, other[, rtol, atol, …])

Compares self with another array and returns True if they have the same axes and elements, False otherwise.

LArray.eq(self, other[, rtol, atol, nans_equal])

Compares self with another array element-wise and returns an array of booleans.

LArray.isin(self, test_values[, …])

Computes whether each element of this array is in test_values.

LArray.nonzero(self)

Returns the indices of the elements that are non-zero.

LArray.all(*axes_and_groups[, out, skipna, …])

Test whether all selected elements evaluate to True.

LArray.all_by(*axes_and_groups[, out, …])

Test whether all selected elements evaluate to True.

LArray.any(*axes_and_groups[, out, skipna, …])

Test whether any selected elements evaluate to True.

LArray.any_by(*axes_and_groups[, out, …])

Test whether any selected elements evaluate to True.

LArray.min(*axes_and_groups[, out, skipna, …])

Get minimum of array elements along given axes/groups.

LArray.min_by(*axes_and_groups[, out, …])

Get minimum of array elements for the given axes/groups.

LArray.max(*axes_and_groups[, out, skipna, …])

Get maximum of array elements along given axes/groups.

LArray.max_by(*axes_and_groups[, out, …])

Get maximum of array elements for the given axes/groups.

LArray.labelofmin(self[, axis])

Returns labels of the minimum values along a given axis.

LArray.indexofmin(self[, axis])

Returns indices of the minimum values along a given axis.

LArray.labelofmax(self[, axis])

Returns labels of the maximum values along a given axis.

LArray.indexofmax(self[, axis])

Returns indices of the maximum values along a given axis.

Iterating

LArray.keys(self[, axes, ascending])

Returns a view on the array labels along axes.

LArray.values(self[, axes, ascending])

Returns a view on the values of the array along axes.

LArray.items(self[, axes, ascending])

Returns a (label, value) view of the array along axes.

Operators

@

Matrix multiplication

Miscellaneous

LArray.divnot0(self, other)

Divides array by other, but returns 0.0 where other is 0.

LArray.clip(self[, minval, maxval, out])

Clip (limit) the values in an array.

LArray.shift(self, axis[, n])

Shifts the cells of the array n-times to the right along axis.

LArray.roll(self[, axis, n])

Rolls the cells of the array n-times to the right along axis.

LArray.diff(self[, axis, d, n, label])

Calculates the n-th order discrete difference along a given axis.

LArray.unique(self[, axes, sort, sep])

Returns unique values (optionally along axes)

LArray.to_clipboard(self, \*args, \*\*kwargs)

Sends the content of the array to clipboard.

Converting to Pandas objects

LArray.to_series(self[, name, dropna])

Converts LArray into Pandas Series.

LArray.to_frame(self[, fold_last_axis_name, …])

Converts LArray into Pandas DataFrame.

Plotting

LArray.plot

Plots the data of the array into a graph (window pop-up).

Utility Functions

Miscellaneous

where(condition, x, y)

Return elements, either from x or y, depending on condition.

maximum(x1, x2[, out, dtype])

Element-wise maximum of array elements.

minimum(x1, x2[, out, dtype])

Element-wise minimum of array elements.

inverse(\*args, \*\*kwargs)

Compute the (multiplicative) inverse of a matrix.

interp(\*args, \*\*kwargs)

One-dimensional linear interpolation.

convolve(\*args, \*\*kwargs)

Returns the discrete, linear convolution of two one-dimensional sequences.

absolute(x, /[, out, where, casting, order, …])

Calculate the absolute value element-wise.

fabs(x, /[, out, where, casting, order, …])

Compute the absolute values element-wise.

isnan(x, /[, out, where, casting, order, …])

Test element-wise for NaN and return result as a boolean array.

isinf(x, /[, out, where, casting, order, …])

Test element-wise for positive or negative infinity.

nan_to_num(\*args, \*\*kwargs)

Replace NaN with zero and infinity with large finite numbers (default behaviour) or with the numbers defined by the user using the nan, posinf and/or neginf keywords.

sqrt(x, /[, out, where, casting, order, …])

Return the non-negative square-root of an array, element-wise.

i0(\*args, \*\*kwargs)

Modified Bessel function of the first kind, order 0.

sinc(\*args, \*\*kwargs)

Return the sinc function.

Rounding

round(\*args, \*\*kwargs)

Round an array to the given number of decimals.

floor(x, /[, out, where, casting, order, …])

Return the floor of the input, element-wise.

ceil(x, /[, out, where, casting, order, …])

Return the ceiling of the input, element-wise.

trunc(x, /[, out, where, casting, order, …])

Return the truncated value of the input, element-wise.

rint(x, /[, out, where, casting, order, …])

Round elements of the array to the nearest integer.

fix(\*args, \*\*kwargs)

Round to nearest integer towards zero.

Exponents And Logarithms

exp(x, /[, out, where, casting, order, …])

Calculate the exponential of all elements in the input array.

expm1(x, /[, out, where, casting, order, …])

Calculate exp(x) - 1 for all elements in the array.

exp2(x, /[, out, where, casting, order, …])

Calculate 2**p for all p in the input array.

log(x, /[, out, where, casting, order, …])

Natural logarithm, element-wise.

log10(x, /[, out, where, casting, order, …])

Return the base 10 logarithm of the input array, element-wise.

log2(x, /[, out, where, casting, order, …])

Base-2 logarithm of x.

log1p(x, /[, out, where, casting, order, …])

Return the natural logarithm of one plus the input array, element-wise.

logaddexp(x1, x2, /[, out, where, casting, …])

Logarithm of the sum of exponentiations of the inputs.

logaddexp2(x1, x2, /[, out, where, casting, …])

Logarithm of the sum of exponentiations of the inputs in base-2.

Trigonometric functions

sin(x, /[, out, where, casting, order, …])

Trigonometric sine, element-wise.

cos(x, /[, out, where, casting, order, …])

Cosine element-wise.

tan(x, /[, out, where, casting, order, …])

Compute tangent element-wise.

arcsin(x, /[, out, where, casting, order, …])

Inverse sine, element-wise.

arccos(x, /[, out, where, casting, order, …])

Trigonometric inverse cosine, element-wise.

arctan(x, /[, out, where, casting, order, …])

Trigonometric inverse tangent, element-wise.

hypot(x1, x2, /[, out, where, casting, …])

Given the “legs” of a right triangle, return its hypotenuse.

arctan2(x1, x2, /[, out, where, casting, …])

Element-wise arc tangent of x1/x2 choosing the quadrant correctly.

degrees(x, /[, out, where, casting, order, …])

Convert angles from radians to degrees.

radians(x, /[, out, where, casting, order, …])

Convert angles from degrees to radians.

unwrap(\*args, \*\*kwargs)

Unwrap by changing deltas between values to 2*pi complement.

Hyperbolic functions

sinh(x, /[, out, where, casting, order, …])

Hyperbolic sine, element-wise.

cosh(x, /[, out, where, casting, order, …])

Hyperbolic cosine, element-wise.

tanh(x, /[, out, where, casting, order, …])

Compute hyperbolic tangent element-wise.

arcsinh(x, /[, out, where, casting, order, …])

Inverse hyperbolic sine element-wise.

arccosh(x, /[, out, where, casting, order, …])

Inverse hyperbolic cosine, element-wise.

arctanh(x, /[, out, where, casting, order, …])

Inverse hyperbolic tangent element-wise.

Complex Numbers

angle(\*args, \*\*kwargs)

Return the angle of the complex argument.

real(\*args, \*\*kwargs)

Return the real part of the complex argument.

imag(\*args, \*\*kwargs)

Return the imaginary part of the complex argument.

conj(x, /[, out, where, casting, order, …])

Return the complex conjugate, element-wise.

Floating Point Routines

signbit(x, /[, out, where, casting, order, …])

Returns element-wise True where signbit is set (less than zero).

copysign(x1, x2, /[, out, where, casting, …])

Change the sign of x1 to that of x2, element-wise.

frexp(x[, out1, out2], / [[, out, where, …])

Decompose the elements of x into mantissa and twos exponent.

ldexp(x1, x2, /[, out, where, casting, …])

Returns x1 * 2**x2, element-wise.

Metadata

Metadata

An ordered dictionary allowing key-values accessibly using attribute notation (AttributeDict.attribute) instead of key notation (Dict[“key”]).

Input/Output

Read

read_csv(filepath_or_buffer[, nb_axes, …])

Reads csv file and returns an array with the contents.

read_tsv(filepath_or_buffer, \*\*kwargs)

read_excel(filepath[, sheet, nb_axes, …])

Reads excel file from sheet name and returns an LArray with the contents

read_hdf(filepath_or_buffer, key[, …])

Reads an axis or group or array named key from a HDF5 file in filepath (path+name)

read_eurostat(filepath_or_buffer, \*\*kwargs)

Reads EUROSTAT TSV (tab-separated) file into an array.

read_sas(filepath[, nb_axes, index_col, …])

Reads sas file and returns an LArray with the contents

read_stata(filepath_or_buffer[, index_col, …])

Reads Stata .dta file and returns an LArray with the contents

Write

LArray.to_csv(self, filepath[, sep, na_rep, …])

Writes array to a csv file.

LArray.to_excel(self[, filepath, sheet, …])

Writes array in the specified sheet of specified excel workbook.

LArray.to_hdf(self, filepath, key)

Writes array to a HDF file.

LArray.to_stata(self, filepath_or_buffer, …)

Writes array to a Stata .dta file.

LArray.dump(self[, header, wide, …])

Dump array as a 2D nested list.

Excel

open_excel([filepath, overwrite_file, …])

Open an Excel workbook

Workbook([filepath, overwrite_file, …])

Excel Workbook.

Workbook.sheet_names(self)

Returns the names of the Excel sheets.

Workbook.save(self[, path])

Saves the Workbook.

Workbook.close(self)

Close the workbook in Excel.

Workbook.app(self)

Return the Excel instance this workbook is attached to.

ExcelReport

ExcelReport()

Automate the generation of multiple graphs in an Excel file.

ExcelReport.template_dir

Set the path to the directory containing the Excel template files (with ‘.crtx’ extension).

ExcelReport.template

Set a default Excel template file.

ExcelReport.set_item_default_size(self, kind)

Override the default ‘width’ and ‘height’ values for the given kind of item.

ExcelReport.graphs_per_row

Default number of graphs per row.

ExcelReport.new_sheet(self, sheet_name)

Add a new empty output sheet.

ExcelReport.sheet_names(self)

Returns the names of the output sheets.

ExcelReport.to_excel(self, filepath[, …])

Generate the report Excel file.

ReportSheet

ReportSheet()

Represents a sheet dedicated to contains only graphical items (title banners, graphs).

ReportSheet.template_dir

Set the path to the directory containing the Excel template files (with ‘.crtx’ extension).

ReportSheet.template

Set a default Excel template file.

ReportSheet.set_item_default_size(self, kind)

Override the default ‘width’ and ‘height’ values for the given kind of item.

ReportSheet.graphs_per_row

Default number of graphs per row.

ReportSheet.add_title(self, title[, width, …])

Add a title item to the current sheet.

ReportSheet.add_graph(self, data[, title, …])

Add a graph item to the current sheet.

ReportSheet.add_graphs(self, …[, …])

Add multiple graph items to the current sheet.

ReportSheet.newline(self)

Force a new row of graphs.

Miscellaneous

aslarray(a[, meta])

Converts input as LArray if possible.

from_frame(df[, sort_rows, sort_columns, …])

Converts Pandas DataFrame into LArray.

from_series(s[, sort_rows, fill_value, meta])

Converts Pandas Series into LArray.

get_example_filepath(fname)

Return absolute path to an example file if exist.

set_options(**kwargs)

Set options for larray in a controlled context.

get_options()

Return the current options.

labels_array(axes[, title, meta])

Returns an array with specified axes and the combination of corresponding labels as values.

union(\*args)

Returns the union of several “value strings” as a list.

stack([elements, axes, title, meta, dtype, …])

Combines several arrays or sessions along an axis.

identity(axis)

diag(a[, k, axes, ndim, split])

Extracts a diagonal or construct a diagonal array.

eye(rows[, columns, k, title, dtype, meta])

Returns a 2-D array with ones on the diagonal and zeros elsewhere.

ipfp(target_sums[, a, axes, maxiter, …])

Apply Iterative Proportional Fitting Procedure (also known as bi-proportional fitting in statistics, RAS algorithm in economics) to array a, with target_sums as targets.

wrap_elementwise_array_func(func)

Wrap a function using numpy arrays to work with LArray arrays instead.

zip_array_values(values[, axes, ascending])

Returns a sequence as if simultaneously iterating on several arrays.

zip_array_items(values[, axes, ascending])

Returns a sequence as if simultaneously iterating on several arrays as well as the current iteration “key”.

Session

Session(*args, **kwargs)

Groups several objects together.

arrays([depth, include_private, meta])

Returns a session containing all available arrays (whether they are defined in local or global variables) sorted in alphabetical order.

local_arrays([depth, include_private, meta])

Returns a session containing all local arrays sorted in alphabetical order.

global_arrays([depth, include_private, meta])

Returns a session containing all global arrays sorted in alphabetical order.

load_example_data(name)

Load arrays used in the tutorial so that all examples in it can be reproduced.

Exploring

Session.names

Returns the list of names of the objects in the session.

Session.keys(self)

Returns a view on the session’s keys.

Session.values(self)

Returns a view on the session’s values.

Session.items(self)

Returns a view of the session’s items ((key, value) pairs).

Session.summary(self[, template])

Returns a summary of the content of the session.

Copying

Session.copy(self)

Returns a copy of the session.

Testing

Session.element_equals(self, other)

Test if each element (group, axis and array) of the current session equals the corresponding element of another session.

Session.equals(self, other)

Test if all elements (groups, axes and arrays) of the current session are equal to those of another session.

Selecting

Session.get(self, key[, default])

Returns the object corresponding to the key.

Modifying

Session.add(self, \*args, \*\*kwargs)

Adds objects to the current session.

Session.update(self[, other])

Update the session with the key/value pairs from other or passed keyword arguments, overwriting existing keys.

Session.get(self, key[, default])

Returns the object corresponding to the key.

Session.apply(self, func, \*args, \*\*kwargs)

Apply function func on elements of the session and return a new session.

Session.transpose(self, \*args)

Reorder axes of arrays in session, ignoring missing axes for each array.

Filtering/Cleaning

Session.filter(self[, pattern, kind])

Returns a new session with objects which match some criteria.

Session.compact(self[, display])

Detects and removes “useless” axes (ie axes for which values are constant over the whole axis) for all array objects in session

Load/Save

Session.load(self, fname[, names, engine, …])

Load LArray, Axis and Group objects from a file, or several .csv files.

Session.save(self, fname[, names, engine, …])

Dumps LArray, Axis and Group objects from the current session to a file.

Session.to_csv(self, fname[, names, display])

Dumps LArray, Axis and Group objects from the current session to CSV files.

Session.to_excel(self, fname[, names, …])

Dumps LArray, Axis and Group objects from the current session to an Excel file.

Session.to_hdf(self, fname[, names, …])

Dumps LArray, Axis and Group objects from the current session to an HDF file.

Session.to_pickle(self, fname[, names, …])

Dumps LArray, Axis and Group objects from the current session to a file using pickle.

Editor

view([obj, title, depth])

Opens a new viewer window.

edit([obj, title, minvalue, maxvalue, …])

Opens a new editor window.

compare(\*args, \*\*kwargs)

Opens a new comparator window, comparing arrays or sessions.

run_editor_on_exception([root_path, …])

Runs the editor when an unhandled exception (a fatal error) happens.

Random

random.randint(low[, high, axes, dtype, meta])

Return random integers from low (inclusive) to high (exclusive).

random.normal([loc, scale, axes, meta])

Draw random samples from a normal (Gaussian) distribution.

random.uniform([low, high, axes, meta])

Draw samples from a uniform distribution.

random.permutation(x[, axis])

Randomly permute a sequence along an axis, or return a permuted range.

random.choice([choices, axes, replace, p, meta])

Generates a random sample from given choices

Constants

nan

NaN (Not a Number)

inf

\(\infty\) (infinite)

pi

\(\pi\)

e

\(e\)

euler_gamma

Euler’s \(\gamma\)