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. |
Searching¶
Axis.index(key) |
Translates a label key to its numerical index counterpart. |
Axis.containing(substring) |
Returns a group with all the labels containing the specified substring. |
Axis.startingwith(prefix) |
Returns a group with the labels starting with the specified string. |
Axis.endingwith(suffix) |
Returns a group with the labels ending with the specified string. |
Axis.matching([deprecated, pattern, regex]) |
Returns a group with all the labels matching the specified pattern or regular expression. |
Axis.min() |
Get minimum of labels. |
Axis.max() |
Get maximum of labels. |
Modifying/Selecting¶
Axis.__getitem__(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(length[, step, template]) |
Split axis into several groups of specified length. |
Axis.rename(name) |
Renames the axis. |
Axis.subaxis(key) |
Returns an axis for a sub-array. |
Axis.extend(labels) |
Append new labels to an axis or increase its length in case of wildcard axis. |
Axis.insert(new_labels[, before, after]) |
Return a new axis with new_labels inserted before before or after after. |
Axis.replace(old[, new]) |
Returns a new axis with some labels replaced. |
Axis.apply(func) |
Returns a new axis with the labels transformed by func. |
Axis.union(other) |
Returns axis with the union of this axis labels and other labels. |
Axis.intersection(other) |
Returns axis with the (set) intersection of this axis labels and other labels. |
Axis.difference(other) |
Returns axis with the (set) difference of this axis labels and other labels. |
Axis.align(other[, join]) |
Align axis with other object using specified join method. |
Axis.split([sep, names, regex, return_labels]) |
Split axis and returns a list of Axis. |
Axis.ignore_labels() |
Returns a wildcard axis with the same name and length than this axis. |
Axis.astype(dtype, numpy.dtype], casting) |
Cast labels to a specified type. |
Testing¶
Axis.iscompatible(other) |
Checks if self is compatible with another axis. |
Axis.equals(other) |
Checks if self is equal to another axis. |
Save¶
Axis.to_hdf(filepath[, key]) |
Writes axis to a HDF file. |
Group¶
IGroup¶
IGroup(key[, name, axis]) |
Index Group. |
IGroup.named(name) |
Returns group with a different name. |
IGroup.with_axis(axis) |
Returns group with a different axis. |
IGroup.by(length[, step, template]) |
Split group into several groups of specified length. |
IGroup.equals(other) |
Checks if this group is equal to another group. |
IGroup.translate([bound, stop]) |
compute position(s) of group |
IGroup.union(other) |
Returns (set) union of this label group and other. |
IGroup.intersection(other) |
Returns (set) intersection of this label group and other. |
IGroup.difference(other) |
Returns (set) difference of this label group and other. |
IGroup.containing(substring) |
Returns a group with all the labels containing the specified substring. |
IGroup.startingwith(prefix) |
Returns a group with the labels starting with the specified string. |
IGroup.endingwith(suffix) |
Returns a group with the labels ending with the specified string. |
IGroup.matching([deprecated, pattern, regex]) |
Returns a group with all the labels matching the specified pattern or regular expression. |
IGroup.to_hdf(filepath[, key, axis_key]) |
Writes group to a HDF file. |
LGroup¶
LGroup(key[, name, axis]) |
Label group. |
LGroup.named(name) |
Returns group with a different name. |
LGroup.with_axis(axis) |
Returns group with a different axis. |
LGroup.by(length[, step, template]) |
Split group into several groups of specified length. |
LGroup.equals(other) |
Checks if this group is equal to another group. |
LGroup.translate([bound, stop]) |
compute position(s) of group |
LGroup.union(other) |
Returns (set) union of this label group and other. |
LGroup.intersection(other) |
Returns (set) intersection of this label group and other. |
LGroup.difference(other) |
Returns (set) difference of this label group and other. |
LGroup.containing(substring) |
Returns a group with all the labels containing the specified substring. |
LGroup.startingwith(prefix) |
Returns a group with the labels starting with the specified string. |
LGroup.endingwith(suffix) |
Returns a group with the labels ending with the specified string. |
LGroup.matching([deprecated, pattern, regex]) |
Returns a group with all the labels matching the specified pattern or regular expression. |
LGroup.to_hdf(filepath[, key, axis_key]) |
Writes group to a HDF file. |
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() |
Returns a copy. |
Searching¶
AxisCollection.keys() |
Returns list of all axis names. |
AxisCollection.index(axis[, compatible]) |
Returns the index of axis. |
AxisCollection.axis_id(axis) |
Returns the id of an axis. |
AxisCollection.ids |
Returns the list of ids of the axes. |
AxisCollection.iter_labels([axes, ascending]) |
Returns a view of the axes labels. |
Modifying/Selecting¶
AxisCollection.get(key[, default, name]) |
Returns axis corresponding to key. |
AxisCollection.get_by_pos(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(key) |
Returns all axes from key if present and length 1 wildcard axes otherwise. |
AxisCollection.pop([axis]) |
Removes and returns an axis. |
AxisCollection.append(axis) |
Appends axis at the end of the collection. |
AxisCollection.extend(axes[, validate, …]) |
Extends the collection by appending the axes from axes. |
AxisCollection.insert(index, axis) |
Inserts axis before index. |
AxisCollection.rename([renames, to]) |
Renames axes of the collection. |
AxisCollection.replace([axes_to_replace, …]) |
Replace one, several or all axes of the collection. |
AxisCollection.set_labels([axis, labels, …]) |
Replaces the labels of one or several axes. |
AxisCollection.without(axes) |
Returns a new collection without some axes. |
AxisCollection.combine_axes([axes, sep, …]) |
Combine several axes into one. |
AxisCollection.split_axes([axes, sep, …]) |
Split axes and returns a new collection |
AxisCollection.align(other[, join, axes]) |
Align this axis collection with another. |
Testing¶
AxisCollection.isaxis(value) |
Tests if input is an Axis object or the name of an axis contained in self. |
AxisCollection.check_compatible(axes) |
Checks if axes passed as argument are compatible with those contained in the collection. |
Array¶
- Overview
- Array Creation Functions
- Copying
- Inspecting
- Modifying/Selecting
- Changing Axes or Labels
- Aggregation Functions
- Sorting
- Reshaping/Extending/Reordering
- Testing/Searching
- Iterating
- Operators
- Miscellaneous
- Converting to Pandas objects
- Plotting
Overview¶
Array(data[, axes, title, meta, dtype]) |
An Array 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¶
Array.copy() |
Returns a copy of the array. |
Array.astype(dtype[, order, casting, subok, …]) |
Copy of the array, cast to a specified type. |
Inspecting¶
| Array.data | Data of the array (Numpy ndarray) |
| Array.axes | Axes of the array (AxisCollection) |
| Array.title | Title of the array (str) |
Array.info |
Describes an Array (metadata + shape and labels for each axis). |
Array.shape |
Returns the shape of the array as a tuple. |
Array.ndim |
Returns the number of dimensions of the array. |
Array.dtype |
Returns the type of the data of the array. |
Array.size |
Returns the number of elements in array. |
Array.nbytes |
Returns the number of bytes used to store the array in memory. |
Array.memory_used |
Returns the memory consumed by the array in human readable form. |
Modifying/Selecting¶
Array.i |
Allows selection of a subset using indices of labels. |
Array.points |
Allows selection of arbitrary items in the array based on their N-dimensional label index. |
Array.ipoints |
Allows selection of arbitrary items in the array based on their N-dimensional index. |
Array.iflat |
Access the array by index as if it was flat (one dimensional) and all its axes were combined. |
Array.set(value, **kwargs) |
Sets a subset of array to value. |
Array.drop([labels]) |
Return array without some labels or indices along an axis. |
Array.ignore_labels([axes]) |
Ignore labels from axes (replace those axes by “wildcard” axes). |
Array.filter([collapse]) |
Filters the array along the axes given as keyword arguments. |
Array.apply(transform, *args, **kwargs) |
Apply a transformation function to array elements. |
Array.apply_map(mapping[, dtype]) |
Apply a transformation mapping to array elements. |
Changing Axes or Labels¶
Array.set_axes([axes_to_replace, new_axis, …]) |
Replace one, several or all axes of the array. |
Array.rename([renames, to, inplace]) |
Renames axes of the array. |
Array.set_labels([axis, labels, inplace]) |
Replaces the labels of one or several axes of the array. |
Array.combine_axes([axes, sep, wildcard]) |
Combine several axes into one. |
Array.split_axes([axes, sep, names, regex, …]) |
Split axes and returns a new array |
Array.reverse([axes]) |
Reverse axes of an array |
Aggregation Functions¶
Array.sum(*axes_and_groups[, dtype, out, …]) |
Computes the sum of array elements along given axes/groups. |
Array.sum_by(*axes_and_groups[, dtype, out, …]) |
Computes the sum of array elements for the given axes/groups. |
Array.prod(*axes_and_groups[, dtype, out, …]) |
Computes the product of array elements along given axes/groups. |
Array.prod_by(*axes_and_groups[, dtype, …]) |
Computes the product of array elements for the given axes/groups. |
Array.cumsum([axis]) |
Returns the cumulative sum of array elements along an axis. |
Array.cumprod([axis]) |
Returns the cumulative product of array elements. |
Array.mean(*axes_and_groups[, dtype, out, …]) |
Computes the arithmetic mean. |
Array.mean_by(*axes_and_groups[, dtype, …]) |
Computes the arithmetic mean. |
Array.median(*axes_and_groups[, out, …]) |
Computes the arithmetic median. |
Array.median_by(*axes_and_groups[, out, …]) |
Computes the arithmetic median. |
Array.var(*axes_and_groups[, dtype, ddof, …]) |
Computes the unbiased variance. |
Array.var_by(*axes_and_groups[, dtype, …]) |
Computes the unbiased variance. |
Array.std(*axes_and_groups[, dtype, ddof, …]) |
Computes the sample standard deviation. |
Array.std_by(*axes_and_groups[, dtype, …]) |
Computes the sample standard deviation. |
Array.percentile(q, *axes_and_groups[, out, …]) |
Computes the qth percentile of the data along the specified axis. |
Array.percentile_by(q, *axes_and_groups[, …]) |
Computes the qth percentile of the data for the specified axis. |
Array.ptp(*axes_and_groups[, out]) |
Returns the range of values (maximum - minimum). |
Array.with_total(*args[, op, label]) |
Add aggregated values (sum by default) along each axis. |
Array.percent(*axes) |
Returns an array with values given as percent of the total of all values along given axes. |
Array.ratio(*axes) |
Returns an array with all values divided by the sum of values along given axes. |
Array.rationot0(*axes) |
Returns an Array with values array / array.sum(axes) where the sum is not 0, 0 otherwise. |
Array.growth_rate([axis, d, label]) |
Calculates the growth along a given axis. |
Array.describe(*args, **kwargs) |
Descriptive summary statistics, excluding NaN values. |
Array.describe_by(*args, **kwargs) |
Descriptive summary statistics, excluding NaN values, along axes or for groups. |
Sorting¶
Array.sort_axes([axes, ascending]) |
Sorts axes of the array. |
Array.sort_values([key, axis, ascending]) |
Sorts values of the array. |
Array.labelsofsorted([axis, ascending, kind]) |
Returns the labels that would sort this array. |
Array.indicesofsorted([axis, ascending, kind]) |
Returns the indices that would sort this array. |
Reshaping/Extending/Reordering¶
Array.reshape(target_axes) |
Given a list of new axes, changes the shape of the array. |
Array.reshape_like(target) |
Same as reshape but with an array as input. |
Array.compact() |
Detects and removes “useless” axes (ie axes for which values are constant over the whole axis) |
Array.reindex([axes_to_reindex, new_axis, …]) |
Reorder and/or add new labels in axes. |
Array.transpose(*args) |
Reorder axes. |
Array.expand([target_axes, out, readonly]) |
Expands array to target_axes. |
Array.prepend(axis, value[, label]) |
Adds an array before self along an axis. |
Array.append(axis, value[, label]) |
Adds an array to self along an axis. |
Array.extend(axis, other) |
Adds an array to self along an axis. |
Array.insert(value[, before, after, pos, …]) |
Inserts value in array along an axis. |
Array.broadcast_with(target[, check_compatible]) |
Returns an array that is (NumPy) broadcastable with target. |
Array.align(other[, join, fill_value, axes]) |
Align two arrays on their axes with the specified join method. |
Testing/Searching¶
Array.equals(other[, rtol, atol, …]) |
Compares self with another array and returns True if they have the same axes and elements, False otherwise. |
Array.allclose(other, rtol, atol, …) |
Compares self with another array and returns True if they are element-wise equal within a tolerance. |
Array.eq(other[, rtol, atol, nans_equal]) |
Compares self with another array element-wise and returns an array of booleans. |
Array.isin(test_values[, assume_unique, invert]) |
Computes whether each element of this array is in test_values. |
Array.nonzero() |
Returns the indices of the elements that are non-zero. |
Array.all(*axes_and_groups[, out, skipna, …]) |
Test whether all selected elements evaluate to True. |
Array.all_by(*axes_and_groups[, out, …]) |
Test whether all selected elements evaluate to True. |
Array.any(*axes_and_groups[, out, skipna, …]) |
Test whether any selected elements evaluate to True. |
Array.any_by(*axes_and_groups[, out, …]) |
Test whether any selected elements evaluate to True. |
Array.min(*axes_and_groups[, out, skipna, …]) |
Get minimum of array elements along given axes/groups. |
Array.min_by(*axes_and_groups[, out, …]) |
Get minimum of array elements for the given axes/groups. |
Array.max(*axes_and_groups[, out, skipna, …]) |
Get maximum of array elements along given axes/groups. |
Array.max_by(*axes_and_groups[, out, …]) |
Get maximum of array elements for the given axes/groups. |
Array.labelofmin([axis]) |
Returns labels of the minimum values along a given axis. |
Array.indexofmin([axis]) |
Returns indices of the minimum values along a given axis. |
Array.labelofmax([axis]) |
Returns labels of the maximum values along a given axis. |
Array.indexofmax([axis]) |
Returns indices of the maximum values along a given axis. |
Iterating¶
Array.keys([axes, ascending]) |
Returns a view on the array labels along axes. |
Array.values([axes, ascending]) |
Returns a view on the values of the array along axes. |
Array.items([axes, ascending]) |
Returns a (label, value) view of the array along axes. |
Operators¶
@ |
Matrix multiplication |
Miscellaneous¶
Array.divnot0(other) |
Divides array by other, but returns 0.0 where other is 0. |
Array.clip([minval, maxval, out]) |
Clip (limit) the values in an array. |
Array.shift(axis[, n]) |
Shifts the cells of the array n-times to the right along axis. |
Array.roll([axis, n]) |
Rolls the cells of the array n-times to the right along axis. |
Array.diff([axis, d, n, label]) |
Calculates the n-th order discrete difference along a given axis. |
Array.unique([axes, sort, sep]) |
Returns unique values (optionally along axes) |
Array.to_clipboard(*args, **kwargs) |
Sends the content of the array to clipboard. |
Converting to Pandas objects¶
Array.to_series([name, dropna]) |
Converts an Array into a Pandas Series. |
Array.to_frame([fold_last_axis_name, dropna]) |
Converts an Array into a Pandas DataFrame. |
Plotting¶
Array.plot |
Plots the data of the array into a graph (window pop-up). |
Utility Functions¶
- Miscellaneous
- Rounding
- Exponents And Logarithms
- Trigonometric functions
- Hyperbolic functions
- Complex Numbers
- Floating Point Routines
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 for monotonically increasing sample points. |
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. |
isscalar(element) |
Returns True if the type of element is a scalar type. |
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 normalized 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 taking the complement of large deltas with respect to the period. |
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 Array with the contents |
read_hdf(filepath_or_buffer, key[, …]) |
Reads a scalar or 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 Array with the contents |
read_stata(filepath_or_buffer[, index_col, …]) |
Reads Stata .dta file and returns an Array with the contents |
Write¶
Array.to_csv(filepath[, sep, na_rep, wide, …]) |
Writes array to a csv file. |
Array.to_excel([filepath, sheet, position, …]) |
Writes array in the specified sheet of specified excel workbook. |
Array.to_hdf(filepath, key) |
Writes array to a HDF file. |
Array.to_stata(filepath_or_buffer, **kwargs) |
Writes array to a Stata .dta file. |
Array.dump(self[, header, wide, value_name, …]) |
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() |
Returns the names of the Excel sheets. |
Workbook.save([path]) |
Saves the Workbook. |
Workbook.close() |
Close the workbook in Excel. |
Workbook.app() |
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(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(sheet_name) |
Add a new empty output sheet. |
ExcelReport.sheet_names() |
Returns the names of the output sheets. |
ExcelReport.to_excel(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(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(title[, width, …]) |
Add a title item to the current sheet. |
ReportSheet.add_graph(data[, title, …]) |
Add a graph item to the current sheet. |
ReportSheet.add_graphs(array_per_title, …) |
Add multiple graph items to the current sheet. |
ReportSheet.newline() |
Force a new row of graphs. |
Miscellaneous¶
asarray(a[, meta]) |
Converts input as Array if possible. |
from_frame(df[, sort_rows, sort_columns, …]) |
Converts Pandas DataFrame into Array. |
from_series(s[, sort_rows, fill_value, meta]) |
Converts Pandas Series into Array. |
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[, doc]) |
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() |
Returns a view on the session’s keys. |
Session.values() |
Returns a view on the session’s values. |
Session.items() |
Returns a view of the session’s items ((key, value) pairs). |
Session.summary([template]) |
Returns a summary of the content of the session. |
Copying¶
Session.copy() |
Returns a copy of the session. |
Testing¶
Session.element_equals(other) |
Test if each element (group, axis and array) of the current session equals the corresponding element of another session. |
Session.equals(other) |
Test if all elements (groups, axes and arrays) of the current session are equal to those of another session. |
Selecting¶
Session.get(key[, default]) |
Returns the object corresponding to the key. |
Modifying¶
Session.add(*args, **kwargs) |
Adds objects to the current session. |
Session.update([other]) |
Update the session with the key/value pairs from other or passed keyword arguments, overwriting existing keys. |
Session.apply(func, *args, **kwargs) |
Apply function func on elements of the session and return a new session. |
Session.transpose(*args) |
Reorder axes of arrays in session, ignoring missing axes for each array. |
Filtering/Cleaning¶
Session.filter([pattern, kind]) |
Returns a new session with objects which match some criteria. |
Session.compact([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(fname[, names, engine, display]) |
Load objects from a file, or several .csv files. |
Session.save(fname[, names, engine, …]) |
Dumps objects from the current session to a file, or several .csv files. |
Session.to_csv(fname[, names, display]) |
Dumps Array objects from the current session to CSV files. |
Session.to_excel(fname[, names, overwrite, …]) |
Dumps Array objects from the current session to an Excel file. |
Session.to_hdf(fname[, names, overwrite, …]) |
Dumps objects from the current session to an HDF file. |
Session.to_pickle(fname[, names, overwrite, …]) |
Dumps objects from the current session to a file using pickle. |
CheckedArray¶
CheckedArray(axes, dtype) |
CheckedSession¶
CheckedSession(*args, **kwargs) |
This class is intended to be inherited by user defined classes in which the variables of a model are declared. |
CheckedParameters¶
CheckedParameters(*args, **kwargs) |
Same as py:class:CheckedSession but declared variables cannot be modified after initialization. |
Editor¶
view([obj, title, depth]) |
Opens a new viewer window. |
edit([obj, title, minvalue, maxvalue, …]) |
Opens a new editor window. |
debug([depth]) |
Opens a new debug 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 |