From 5e4961593e6414a2fd11fbd7042d5edf7a78654a Mon Sep 17 00:00:00 2001 From: guanjihuan Date: Thu, 4 Jan 2024 18:45:58 +0800 Subject: [PATCH] 0.1.72 --- PyPI/setup.cfg | 2 +- PyPI/src/guan.egg-info/PKG-INFO | 2 +- PyPI/src/guan/data_processing.py | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/PyPI/setup.cfg b/PyPI/setup.cfg index 016d4d7..dcd536c 100644 --- a/PyPI/setup.cfg +++ b/PyPI/setup.cfg @@ -1,7 +1,7 @@ [metadata] # replace with your username: name = guan -version = 0.1.71 +version = 0.1.72 author = guanjihuan author_email = guanjihuan@163.com description = An open source python package diff --git a/PyPI/src/guan.egg-info/PKG-INFO b/PyPI/src/guan.egg-info/PKG-INFO index 33521a7..fa70e57 100644 --- a/PyPI/src/guan.egg-info/PKG-INFO +++ b/PyPI/src/guan.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: guan -Version: 0.1.71 +Version: 0.1.72 Summary: An open source python package Home-page: https://py.guanjihuan.com Author: guanjihuan diff --git a/PyPI/src/guan/data_processing.py b/PyPI/src/guan/data_processing.py index 16f8440..2ef7dda 100644 --- a/PyPI/src/guan/data_processing.py +++ b/PyPI/src/guan/data_processing.py @@ -724,6 +724,12 @@ def preprocess_for_parallel_calculations(parameter_array_all, cpus=1, task_index parameter_array = parameter_array_all[task_index*num_parameter:num_all] return parameter_array +# 根据子数组的第index个元素对子数组进行排序(index从0开始) +@guan.statistics_decorator +def sort_array_by_index_element(original_array, index): + sorted_array = sorted(original_array, key=lambda x: x[index]) + return sorted_array + # 随机获得一个整数,左闭右闭 @guan.statistics_decorator def get_random_number(start=0, end=1):