Skip to main content

A collection of utility functions for working with arrays

Project description

Usage

Here are some examples of how to use the functions in the sortlabs module:

from sortlabs import quick_sort, group_arrays, merge_and_sort_arrays, find_max, find_min, count_occurrences, remove_duplicates, reverse_array

# Quick sort
sorted_arr = quick_sort([5, 2, 8, 1, 9])
print(sorted_arr)  # Output: [1, 2, 5, 8, 9]

# Group arrays
grouped_arr = group_arrays([1, 3, 5], [2, 4, 6])
print(grouped_arr)  # Output: [1, 2, 3, 4, 5, 6]

# Merge and sort arrays
merged_and_sorted_arr = merge_and_sort_arrays([1, 3, 5], [2, 4, 6])
print(merged_and_sorted_arr)  # Output: [1, 2, 3, 4, 5, 6]

# Find maximum and minimum values
max_val = find_max([5, 2, 8, 1, 9])
print(max_val)  # Output: 9
min_val = find_min([5, 2, 8, 1, 9])
print(min_val)  # Output: 1

# Count occurrences
count = count_occurrences([1, 2, 3, 2, 1], 2)
print(count)  # Output: 2

# Remove duplicates
unique_arr = remove_duplicates([1, 2, 3, 2, 1])
print(unique_arr)  # Output: [1, 2, 3]

# Reverse array
reversed_arr = reverse_array([1, 2, 3, 4, 5])
print(reversed_arr)  # Output: [5, 4, 3, 2, 1]

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sortlabs-1.0.tar.gz (2.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sortlabs-1.0-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file sortlabs-1.0.tar.gz.

File metadata

  • Download URL: sortlabs-1.0.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.0

File hashes

Hashes for sortlabs-1.0.tar.gz
Algorithm Hash digest
SHA256 d5b8d1933042b08c1bd4c3f2d6f43a49003c2a8993d392125c89050db312eff2
MD5 33c34a6c9a7f088fa17f8ef341d2d157
BLAKE2b-256 c12e83e3d236a068f5b786dbb5974c94977d0c3a48429302510e94a952327973

See more details on using hashes here.

File details

Details for the file sortlabs-1.0-py3-none-any.whl.

File metadata

  • Download URL: sortlabs-1.0-py3-none-any.whl
  • Upload date:
  • Size: 2.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.0

File hashes

Hashes for sortlabs-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d1be787a928893e61158a63274b511ba8b6f916e684a720c9fbcc0b6f12ca7e6
MD5 90735040640f3ee1a3db176edc71da5c
BLAKE2b-256 6a5754695dc09cca22ea09b93ed677fb874aa8c55e8d3d210eba34ded7a4a798

See more details on using hashes here.

Supported by

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