Skip to main content

arrpy is a 2D array manipulation module

Project description

Arrpy

A lightweight module allowing simple manipulation of 2D arrays using base python list objects. Designed for use in pandas-incompatible situations, such as when working in Jython. Allows import and export of spreadsheets, finding the mean across rows or columns, and row extraction.

download

run 'pip install arrpy'

Import and export

open_df(file, delim_type = "csv", subarray = "col", e = 'utf-8-sig') Open file and return a corresponding list of lists. file is a string denoting the path of the 2D data of interest. delim type is a string denoting the column separators used in file. Currently accepts "csv" and "tab". subarray is a string denoting whether the respective subarrays in the list created will correspond to a row or a columns of file. e is a string denoting the encoding of the file.

write_csv(arr, path, subarray = "col") Write arr to file. arr is a list of lists. file is a string denoting the path to write to. subarray is a string denoting whether the respective subarrays in arr will correspond to a row or column of file.

List manipulation

append_row(arr, row, base_check = True, deep = True) Output a new list object with row appended to arr. arr is a list of lists. row is a list to append to arr. base_check is a boolean to determine whether to run a set of basic compatibilty checks on arr (type, length, dimension count, and raggedness) deep is a boolean to determine whether to append row to a deep (True) or shallow copy of arr (False).

del_row(arr, row, base_check = True) Output a new list object with row deleted from arr. arr is a list of lists. row is an object that is coercible to 0 <= int <= len(arr[0]). base_check is a boolean to determine whether to run a set of basic compatibilty checks on arr (type, length, dimension count, and raggedness)

List processing

avg_col(arr, base_check = True, dim_check = False) Outputs the arithmetic mean of the columns (subarrays) of arr as a list. arr is a list of lists. base_check is a boolean to determine whether to run a set of basic compatibilty checks on arr (type, length, dimension count, and raggedness) dim_check is a boolean to determine whether to check if arr has a consistent number of dimensions. This can be slow for larger arr.

avg_row(arr, base_check = True, dim_check = False) Outputs the arithmetic mean of the rows (a given index of each subarray) of arr as a list. arr is a list of lists. base_check is a boolean to determine whether to run a set of basic compatibilty checks on arr (type, length, dimension count, and raggedness) dim_check is a boolean to determine whether to check if arr has a consistent number of dimensions. This can be slow for larger arr.

row_extract(arr, row, base_check = True) Outputs the selected row (given index of each subarray of arr) as a list. arr is a list of lists. row is an object that is coercible to 0 <= int <= len(arr[0]). base_check is a boolean to determine whether to run a set of basic compatibilty checks on arr (type, length, dimension count, and raggedness) dim_check is a boolean to determine whether to check if arr has a consistent number of dimensions. This can be slow for larger arr.

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

arrpy-1.0.0.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

arrpy-1.0.0-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file arrpy-1.0.0.tar.gz.

File metadata

  • Download URL: arrpy-1.0.0.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.0 pkginfo/1.6.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for arrpy-1.0.0.tar.gz
Algorithm Hash digest
SHA256 ba6fdf8ca614694d4dd1733b6c64cab5038c40bbcb9cf76fe4f6b37497b31a11
MD5 c8128977067ec67788c9ca71de69c30e
BLAKE2b-256 e48c9dc4ae6868eef42314cf76ce7cec90543bbe284c10ae93ec8a5b3e3534d0

See more details on using hashes here.

File details

Details for the file arrpy-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: arrpy-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.0 pkginfo/1.6.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for arrpy-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9eda9669481720653adea6a69b28ece3ba1ca0b53386a7fd3524ae0bee192b18
MD5 372f3fbfde9515d96f994ff068ad1378
BLAKE2b-256 de5d532f7ca9599e0b5ad080c9f7e3af5f1815da49f05e4047d5efbc669ee625

See more details on using hashes here.

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