A small array utlity library
Project description
Array utility
A simple python utility library
What is PyArray ?
Well, PyArray is a simple python-array-utlity library. It contains a set of a array methods which can speed up your development.
How to use it?
Create a pyarray list
import pyarray
PyArray types
Strings
pyarray.string()
# strings
Integers
pyarray.integer()
# integer
Floats
pyarray.floating()
# floating point
Dictionaried , booleans and lists
#dictionaries
pyarray.dictionary()
#boolean values
pyarray.boolean()
# lists
pyarray.lists()
Create a list
arr = pyarray.List(pyarray.integer())
Methods
Length
arr.len()
Add
arr.add(4)
# The array don't support duplicate elements
# no element is added if it already exists
# int the list
elementAt(index:integer)
index = 1
arr.elementAt(index)
median
# find the median
# only for integers and floats
arr.median()
delete_index(index:integer)
arr.delete_index(-1)
search_insert_position
target = 9
arr.search_insert_postion(target)
index
arr.index()
peak
# the index of maximum element
arr.peak_index()
all
arr.all()
# returns all the element
count
arr.count(5)
Maximum and minimum
# maximum
arr.range().maximum()
# minimum
arr.range().minimum()
Choice
arr.choice()
# gives a random element
Other methods
# sort the array
arr.sort()
# find an element
arr.find()
# delete an element
arr.delete(3)
# clear all the element
arr.clear()
# reverse an array
arr.reverse()
arr.alternate_index()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyarray-0.2.tar.gz
(3.3 kB
view details)
File details
Details for the file pyarray-0.2.tar.gz
.
File metadata
- Download URL: pyarray-0.2.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e331e194fe8dbb7ba5fb3d6b5bb8236f76a377b22ca7faf4c86b8120fc45c0e0 |
|
MD5 | d05798de5b5fe8ebdb84516781049b63 |
|
BLAKE2b-256 | f4d746a1c521304b41f021745d2bc9e395ca2c6e01abda3148b5c97792252ef9 |