GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • 
  • Consortium for Python Data API Standards
  • API specification
  • Element-wise Functions
  • Purpose and scope
  • Terms and Definitions
  • Use cases
  • Assumptions
  • Design topics & constraints
  • Future API standard evolution
  • Array object
  • Broadcasting
  • Constants
  • Creation Functions

This view

  • Original page
  • New address

GeezerVison is showing data-apis.org — subtract — Python array API standard DRAFT documentation

subtract¶

subtract(x1: array | int | float | complex, x2: array | int | float | complex, /) → array¶

Calculates the difference for each element x1_i of the input array x1 with the respective element x2_i of the input array x2.

Parameters:
  • x1 (Union[array, int, float, complex]) – first input array. Should have a numeric data type.

  • x2 (Union[array, int, float, complex]) – second input array. Must be compatible with x1 (see Broadcasting). Should have a numeric data type.

Returns:

out (array) – an array containing the element-wise differences. The returned array must have a data type determined by Type Promotion Rules.

Notes

  • At least one of x1 or x2 must be an array.

  • The result of x1_i - x2_i must be the same as x1_i + (-x2_i) and must be governed by the same floating-point rules as addition (see add()).

Changed in version 2022.12: Added complex data type support.

Changed in version 2024.12: Added scalar argument support.

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.