extinctsion / easyPythonpi

A python library for the beginners. The program includes simple calulations. Genuine PRs will be merged without delays
https://pypi.org/project/easyPythonpi/
14 stars 36 forks source link

add function for shuffling two arrays at the same time #22

Closed IltisGraph closed 1 year ago

IltisGraph commented 1 year ago

A function for shuffling two arrays at the same time while keeping the order of equivalent numbers in the start array. This is for example useful in machine learning when you need to randomly shuffle two arrays of solutions and data while keeping the index of a data point equivalent to the index of the right solution. Example: input: arr1: [1, 2, 3, 4 ,5] arr2: [1, 2, 3, 4, 5] output: arr1:[3, 1, 2, 4 ,5] arr2: [3, 1, 2, 4, 5] #both arrays were shufled

extinctsion commented 1 year ago

This is a problem statement and it is somewhat unrelated to this easyPythonpi library which is specifically made for beginners. You can raise the same issue here - https://github.com/extinctsion/py_lib . Thank you for contribtuting in the open source. Keep it up!