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

  • cf 3.21.0
  • Introduction
  • Installation
  • Cheat Sheet
  • Recipes using cf
  • Tutorial
  • API reference
  • Aggregation rules
  • Performance
  • Releases
  • Change log
  • Contributing
  • cf functions
  • cf.free_memory_factor

This view

  • Original page
  • New address

GeezerVison is showing ncas-cms.github.io — cf.hash_array — Documentation

cf.hash_array¶

cf.hash_array(array, algorithm=None)[source]¶

Return a hash value of a numpy array.

Deprecated at version 3.15.0 and is no longer available. Use dask.base.tokenize instead.

The hash value is dependent on the data type and the shape of the array. If the array is a masked array then the hash value is independent of the fill value and of data array values underlying any masked elements.

Parameters:
array: numpy.ndarray

The numpy array to be hashed. May be a masked array.

algorithm: hashlib constructor function

Constructor function for the desired hash algorithm, e.g. hashlib.md5, hashlib.sha256, etc.

Added in version 3.14.0.

Returns:
int

The hash value.

Examples

>>> a = np.array([[0, 1, 2, 3]])
>>> cf.hash_array(a)
-5620332080097671134
>>> a = np.ma.array([[0, 1, 2, 3]], mask=[[0, 1, 0, 0]])
>>> cf.hash_array(array)
8372868545804866378
>>> a[0, 1] = 999
>>> a[0, 1] = np.ma.masked
>>> print(a)
[[0 -- 2 3]]
>>> print(a.data)
[[  0 999   2   3]]
>>> cf.hash_array(a)
8372868545804866378
>>> a = a.astype(float)
>>> cf.hash_array(a)
5950106833921144220
©2026, NCAS | Page built on 2026-08-28. | Powered by Sphinx 9.1.0 & Alabaster 1.0.0
You are visitor 01402503 — 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.