Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am charlzkp on github.
  • I am charlzkp (https://keybase.io/charlzkp) on keybase.
  • I have a public key ASDLPgUksii55ITkfrI7vUDZgq_GxcUajOHKwvtnUGg_jwo

To claim this, I am signing this object:

@CharlZKP
CharlZKP / numpy_compression_util.py
Created August 10, 2023 04:41
faster numpy array compression and decompression speed with slightly smaller size, using zstandard
# This code is licensed under the terms of the MIT license
import numpy as np
import zstandard as zstd
import json
def np_save_compressed(filename, array, compression_level=5):
"""
Save a NumPy array as a compressed file using Zstandard compression.