## vector


A sparse array of index keys mapped to numeric values.


Usage


``` python
vector(
    *args,
    **kwargs,
)
```


Provides a memory efficient Counter interface, with optimized conversion between numpy arrays.


## Parameters


`keys: Iterable[int]`  
optional iterable of keys

`values`  
optional scalar or iterable of values


## Attributes

| Name | Description |
|----|----|
| [__pyx_vtable__](#__pyx_vtable__) | Capsule objects let you wrap a C "void \*" pointer in a Python |

------------------------------------------------------------------------


#### \_\_pyx_vtable\_\_


Capsule objects let you wrap a C "void \*" pointer in a Python


**`pyx_vtable`**`=<capsule object NULL at 0x7fb5e46d6d60>`


object. They're a way of passing data through the Python interpreter without creating your own custom type.

Capsules are used for communication between extension modules. They provide a way for an extension module to export a C interface to other extension modules, so that extension modules can use the Python import mechanism to link to one another.


## Methods

| Name | Description |
|----|----|
| [__abs__()](#__abs__) | abs(self) |
| [__array__()](#__array__) | Return values as numpy array. |
| [__contains__()](#__contains__) | Return bool(key in self). |
| [__delitem__()](#__delitem__) | Delete self\[key\]. |
| [__eq__()](#__eq__) | Return self==value. |
| [__ge__()](#__ge__) | Return self\>=value. |
| [__getitem__()](#__getitem__) | Return self\[key\]. |
| [__gt__()](#__gt__) | Return self\>value. |
| [__iadd__()](#__iadd__) | Return self+=value. |
| [__iand__()](#__iand__) | Return self&=value. |
| [__imul__()](#__imul__) | Return self\*=value. |
| [__init__()](#__init__) | Initialize self. See help(type(self)) for accurate signature. |
| [__ior__()](#__ior__) | Return self\|=value. |
| [__ipow__()](#__ipow__) | Return self\*\*=value. |
| [__isub__()](#__isub__) | Return self-=value. |
| [__iter__()](#__iter__) | Implement iter(self). |
| [__itruediv__()](#__itruediv__) | Return self/=value. |
| [__ixor__()](#__ixor__) | Return self^=value. |
| [__le__()](#__le__) | Return self\<=value. |
| [__len__()](#__len__) | Return len(self). |
| [__lt__()](#__lt__) | Return self\<value. |
| [__matmul__()](#__matmul__) | Return vector dot product. |
| [__ne__()](#__ne__) | Return self!=value. |
| [__neg__()](#__neg__) | -self |
| [__new__()](#__new__) | Create and return a new object. See help(type) for accurate signature. |
| [__pow__()](#__pow__) | Return pow(self, value, mod). |
| [__rand__()](#__rand__) | Return value&self. |
| [__repr__()](#__repr__) | Return repr(self). |
| [__rmatmul__()](#__rmatmul__) | Return value@self. |
| [__ror__()](#__ror__) | Return value\|self. |
| [__rpow__()](#__rpow__) | Return pow(value, self, mod). |
| [__rxor__()](#__rxor__) | Return value^self. |
| [__setitem__()](#__setitem__) | Set self\[key\] to value. |
| [argmax()](#argmax) | Return key with maximum value. |
| [argmin()](#argmin) | Return key with minimum value. |
| [argpartition()](#argpartition) | Return keys partitioned by values. |
| [argsort()](#argsort) | Return keys sorted by values. |
| [clear()](#clear) | Remove all items. |
| [difference()](#difference) | Provisional set difference; return vector without keys. |
| [equal()](#equal) | Return whether vectors are equal as scalar bool; == is element-wise. |
| [filter()](#filter) | Return parallel keys and values where predicate is true. |
| [fromdense()](#fromdense) | Return vector from a dense array representation. |
| [items()](#items) | Generate key and value pairs. |
| [map()](#map) | Return parallel keys and values from applying function across vectors. |
| [max()](#max) | Return maximum value. |
| [maximum()](#maximum) | Return element-wise maximum vector. |
| [min()](#min) | Return minimum value. |
| [minimum()](#minimum) | Return element-wise minimum vector. |
| [sum()](#sum) | Return sum of values. |
| [toarrays()](#toarrays) | Return keys and values as numpy arrays. |
| [todense()](#todense) | Return a dense array representation of vector. |
| [update()](#update) | Update from vector, arrays, mapping, or keys with scalar. |

------------------------------------------------------------------------


#### \_\_abs\_\_()


abs(self)


Usage


``` python
__abs__()
```


------------------------------------------------------------------------


#### \_\_array\_\_()


Return values as numpy array.


Usage


``` python
__array__(dtype=float, copy=None)
```


------------------------------------------------------------------------


#### \_\_contains\_\_()


Return bool(key in self).


Usage


``` python
__contains__(key)
```


------------------------------------------------------------------------


#### \_\_delitem\_\_()


Delete self\[key\].


Usage


``` python
__delitem__(key)
```


------------------------------------------------------------------------


#### \_\_eq\_\_()


Return self==value.


Usage


``` python
__eq__(value)
```


------------------------------------------------------------------------


#### \_\_ge\_\_()


Return self\>=value.


Usage


``` python
__ge__(value)
```


------------------------------------------------------------------------


#### \_\_getitem\_\_()


Return self\[key\].


Usage


``` python
__getitem__(key)
```


------------------------------------------------------------------------


#### \_\_gt\_\_()


Return self\>value.


Usage


``` python
__gt__(value)
```


------------------------------------------------------------------------


#### \_\_iadd\_\_()


Return self+=value.


Usage


``` python
__iadd__(value)
```


------------------------------------------------------------------------


#### \_\_iand\_\_()


Return self&=value.


Usage


``` python
__iand__(value)
```


------------------------------------------------------------------------


#### \_\_imul\_\_()


Return self\*=value.


Usage


``` python
__imul__(value)
```


------------------------------------------------------------------------


#### \_\_init\_\_()


Initialize self. See help(type(self)) for accurate signature.


Usage


``` python
__init__(*args, **kwargs)
```


------------------------------------------------------------------------


#### \_\_ior\_\_()


Return self\|=value.


Usage


``` python
__ior__(value)
```


------------------------------------------------------------------------


#### \_\_ipow\_\_()


Return self\*\*=value.


Usage


``` python
__ipow__(value)
```


------------------------------------------------------------------------


#### \_\_isub\_\_()


Return self-=value.


Usage


``` python
__isub__(value)
```


------------------------------------------------------------------------


#### \_\_iter\_\_()


Implement iter(self).


Usage


``` python
__iter__()
```


------------------------------------------------------------------------


#### \_\_itruediv\_\_()


Return self/=value.


Usage


``` python
__itruediv__(value)
```


------------------------------------------------------------------------


#### \_\_ixor\_\_()


Return self^=value.


Usage


``` python
__ixor__(value)
```


------------------------------------------------------------------------


#### \_\_le\_\_()


Return self\<=value.


Usage


``` python
__le__(value)
```


------------------------------------------------------------------------


#### \_\_len\_\_()


Return len(self).


Usage


``` python
__len__()
```


------------------------------------------------------------------------


#### \_\_lt\_\_()


Return self\<value.


Usage


``` python
__lt__(value)
```


------------------------------------------------------------------------


#### \_\_matmul\_\_()


Return vector dot product.


Usage


``` python
__matmul__()
```


------------------------------------------------------------------------


#### \_\_ne\_\_()


Return self!=value.


Usage


``` python
__ne__(value)
```


------------------------------------------------------------------------


#### \_\_neg\_\_()


-self


Usage


``` python
__neg__()
```


------------------------------------------------------------------------


#### \_\_new\_\_()


Create and return a new object. See help(type) for accurate signature.


Usage


``` python
__new__(*args, **kwargs)
```


------------------------------------------------------------------------


#### \_\_pow\_\_()


Return pow(self, value, mod).


Usage


``` python
__pow__(value, mod=None)
```


------------------------------------------------------------------------


#### \_\_rand\_\_()


Return value&self.


Usage


``` python
__rand__(value)
```


------------------------------------------------------------------------


#### \_\_repr\_\_()


Return repr(self).


Usage


``` python
__repr__()
```


------------------------------------------------------------------------


#### \_\_rmatmul\_\_()


Return value@self.


Usage


``` python
__rmatmul__(value)
```


------------------------------------------------------------------------


#### \_\_ror\_\_()


Return value\|self.


Usage


``` python
__ror__(value)
```


------------------------------------------------------------------------


#### \_\_rpow\_\_()


Return pow(value, self, mod).


Usage


``` python
__rpow__(value, mod=None)
```


------------------------------------------------------------------------


#### \_\_rxor\_\_()


Return value^self.


Usage


``` python
__rxor__(value)
```


------------------------------------------------------------------------


#### \_\_setitem\_\_()


Set self\[key\] to value.


Usage


``` python
__setitem__(key, value)
```


------------------------------------------------------------------------


#### argmax()


Return key with maximum value.


Usage


``` python
argmax(**kwargs)
```


------------------------------------------------------------------------


#### argmin()


Return key with minimum value.


Usage


``` python
argmin(**kwargs)
```


------------------------------------------------------------------------


#### argpartition()


Return keys partitioned by values.


Usage


``` python
argpartition(kth, **kwargs)
```


------------------------------------------------------------------------


#### argsort()


Return keys sorted by values.


Usage


``` python
argsort(**kwargs)
```


------------------------------------------------------------------------


#### clear()


Remove all items.


Usage


``` python
clear()
```


------------------------------------------------------------------------


#### difference()


Provisional set difference; return vector without keys.


Usage


``` python
difference(*others)
```


------------------------------------------------------------------------


#### equal()


Return whether vectors are equal as scalar bool; == is element-wise.


Usage


``` python
equal(other)
```


------------------------------------------------------------------------


#### filter()


Return parallel keys and values where predicate is true.


Usage


``` python
filter(ufunc, *args, **kwargs)
```


If `ufunc` return indices, then it inherently functions as `take`.


------------------------------------------------------------------------


#### fromdense()


Return vector from a dense array representation.


Usage


``` python
fromdense(values)
```


------------------------------------------------------------------------


#### items()


Generate key and value pairs.


Usage


``` python
items()
```


------------------------------------------------------------------------


#### map()


Return parallel keys and values from applying function across vectors.


Usage


``` python
map(ufunc, *args, **kwargs)
```


------------------------------------------------------------------------


#### max()


Return maximum value.


Usage


``` python
max(initial=None, **kwargs)
```


------------------------------------------------------------------------


#### maximum()


Return element-wise maximum vector.


Usage


``` python
maximum(value)
```


------------------------------------------------------------------------


#### min()


Return minimum value.


Usage


``` python
min(initial=None, **kwargs)
```


------------------------------------------------------------------------


#### minimum()


Return element-wise minimum vector.


Usage


``` python
minimum(value)
```


------------------------------------------------------------------------


#### sum()


Return sum of values.


Usage


``` python
sum(initial=0.0, dtype=float, **kwargs)
```


------------------------------------------------------------------------


#### toarrays()


Return keys and values as numpy arrays.


Usage


``` python
toarrays()
```


------------------------------------------------------------------------


#### todense()


Return a dense array representation of vector.


Usage


``` python
todense(minlength=0, dtype=float)
```


------------------------------------------------------------------------


#### update()


Update from vector, arrays, mapping, or keys with scalar.


Usage


``` python
update(keys, values=1.0)
```
