# Core APIΒΆ

The base object in `bolt` defines a core set of ndarray functionality, as well as a subset functional operators. Different implementations are provided for different settings. The current ones are:

`bolt.local` for local computation with NumPy

`bolt.spark` for distributed computation with Spark

The core methods currently avaialble on all `bolt` arrays are as follows.

Reductions along axes:

sum(axis) |
Return the sum of the array elements over the given axis. |

mean(axis) |
Return the mean of the array elements over the given axis. |

var(axis) |
Return the variance of the array elements over the given axis. |

std(axis) |
Return the standard deviation of the array elements over the given axis. |

max(axis) |
Return the maximum of the array elements over the given axis or axes. |

min(axis) |
Return the minimum of the array elements over the given axis or axes. |

Shaping/transposing:

transpose(axis) |
Return an array with the axes transposed. |

squeeze(axis) |
Remove one or more single-dimensional axes from the array. |

swapaxes(axis1, axis2) |
Return an array with two axes interchanged. |

reshape(axis) |
Return an array with the same data but a new shape. |

T |
Transpose by reversing the order of the axes. |

Properties:

shape |
Size of each dimension. |

size |
Total number of elements. |

ndim |
Number of dimensions. |

dtype |
Data-type of array. |

Functional operators:

map(func, axis) |
Apply a function across one or more axes. |

reduce(func, axis, keepdims) |
Reduce an array across one or more axes. |

filter(func, axis) |
Filter an array across one or more axes. |

And also slicing (e.g. `x[0:10, 0:100]`, `x[0:10, :]`) and indexing (e.g. `x[[0, 1, 2], [0, 1, 3]]`)

We aim to replicate a large fraction of the NumPy API, so if there is something that we are missing that you would be interested in having, or something that you would like to contribute, create an issue.

For further details on the implementations, as well as functionality specific to the different modes, see the documentation for bolt.spark and bolt.local.