{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Arithmetic Operations And Aggregations\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Import the LArray library:\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from larray import *" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Arithmetic operations\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "arr = ndtest((3, 3))\n", "arr" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "One can do all usual arithmetic operations on an array, it will apply the operation to all elements individually\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# addition\n", "arr + 10" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# multiplication\n", "arr * 2" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# 'true' division\n", "arr / 2" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# 'floor' division\n", "arr // 2" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "