Skip to main content

a

Project description

🍀 yotsuba

Documentation

Install yotsuba.

  • Via pip (under construction)
pip install yotsuba-python
  • From source.
git clone https://github.com/yutayamazaki/yotsuba.git
cd yotsuba/bindings/python
python setup.py install

API documents.

yotsuba

yotsuba.pad_sequences(sequences: List[List[int]], maxlen: int, value: int = 1, padding: str = 'post') -> List[List[int]]

Pad sequences with given value like keras.preprocessing.sequence.pad_sequences.

Parameters
  • sequences (List[List[int]]) - Sequences to padded.
  • maxlen (int) - Maximum sequence length to pad.
  • value (int) - A value used to pad sequences.
  • padding (str) - 'pre' or 'post', default is 'post'.
Returns
  • List[List[int]] - An list of integers with shape (len(sequences), maxlen).
Raises
  • ValueError - If padding is not 'pre' or 'post'.
Examples
from typing import List

import yotsuba

sequences: List[List[int]] = [[0, 2, 1], [0, 1]]
padding: List[List[int]] = yotsuba.pad_sequences(
    sequences=sequences, maxlen=5, value=-1, padding='post'
)
assert padding == [[0, 2, 1, -1, -1], [0, 1, -1, -1, -1]]

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

yotsuba-python-0.1.3.tar.gz (7.1 kB view hashes)

Uploaded Source

Built Distributions

yotsuba_python-0.1.3-cp39-cp39-manylinux1_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.9

yotsuba_python-0.1.3-cp38-cp38-win_amd64.whl (511.4 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

yotsuba_python-0.1.3-cp38-cp38-manylinux1_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.8

yotsuba_python-0.1.3-cp38-cp38-macosx_10_11_x86_64.whl (569.9 kB view hashes)

Uploaded CPython 3.8 macOS 10.11+ x86-64

yotsuba_python-0.1.3-cp37-cp37m-win_amd64.whl (511.4 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

yotsuba_python-0.1.3-cp37-cp37m-manylinux1_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.7m

yotsuba_python-0.1.3-cp37-cp37m-macosx_10_11_x86_64.whl (569.9 kB view hashes)

Uploaded CPython 3.7m macOS 10.11+ x86-64

yotsuba_python-0.1.3-cp36-cp36m-win_amd64.whl (511.8 kB view hashes)

Uploaded CPython 3.6m Windows x86-64

yotsuba_python-0.1.3-cp36-cp36m-manylinux1_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.6m

yotsuba_python-0.1.3-cp36-cp36m-macosx_10_11_x86_64.whl (570.1 kB view hashes)

Uploaded CPython 3.6m macOS 10.11+ x86-64

yotsuba_python-0.1.3-cp35-cp35m-win_amd64.whl (511.7 kB view hashes)

Uploaded CPython 3.5m Windows x86-64

yotsuba_python-0.1.3-cp35-cp35m-manylinux1_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.5m

yotsuba_python-0.1.3-cp35-cp35m-macosx_10_11_x86_64.whl (570.1 kB view hashes)

Uploaded CPython 3.5m macOS 10.11+ x86-64

Supported by

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