Skip to main content

Python lattice binning package for large data

Project description

This python package is used for binning onto lattices in multiple dimensions.

Why Use Lattices

For “regular” 2D histogramming you implicitly use a Z2 lattice! But the errors involved with quantizing to a Z2 lattices is larger than A2.

insert plot here showing proper comparison of Z2 and A2 give name of file which creates Z2-A2 comparison

Basic Example

This example shows how to take a normal data set and histogram the data onto an A2 (aka honeycomb) lattice using latbin.

import latbin
import numpy as np

# create some fake data with shape (npts,ndim)
npts,ndim = 60000,2
data = np.random.normal(size=(npts, ndim))*4.0

# create an A2 lattice (honeycomb binning)
a2 = latbin.ALattice(2)

# histogram the data onto A2 Lattice
h = a2.histogram(data)

# get the lattice points in the data space
centers = h.centers()

# show the result
import matplotlib.pylab as plt
plt.title("Honeycomb binning (A2 Lattice)")
plt.scatter(centers[:,0],centers[:,1],c=h.values(), s=70)
plt.show()

Installation

In the terminal you can install this in the usual way.

python setup.py install

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

latbin-0.1.4.tar.gz (18.1 kB view details)

Uploaded Source

File details

Details for the file latbin-0.1.4.tar.gz.

File metadata

  • Download URL: latbin-0.1.4.tar.gz
  • Upload date:
  • Size: 18.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for latbin-0.1.4.tar.gz
Algorithm Hash digest
SHA256 048a08bfece91b86e70fadfa5ead529faa1f2f73e4a2d91bb1756208f8794735
MD5 465c589b76a529a1b2c0c4d86fcb61b8
BLAKE2b-256 9f88fa9530f104b8c8e7bc0a28a0bba9b999a48874e31616f4a4b3827107f01e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page