vectionary

add vector method to dict and Counter


Keywords
dict, counter, vector
License
Other
Install
pip install vectionary==0.1.0

Documentation

vectionary

Install

$ pip install vectionary 

Usage

>>> from vectionary import VectorDict
>>> vd1 = VectorDict(a=1, b=2)
>>> vd1.magnitude()
2.23606797749979
>>> vd2 = VectorDict(a=2, b=1, c=2)
>>> vd1.cosine_similarity(vd2)
0.5962847939999439