EADST

Numpy: Obtain the Indices to Sort An Array

Numpy: Obtain the Indices to Sort An Array

x = np.array([[0, 3], [2, 2]]) #  array([[0, 3],  [2, 2]])
col_idx = np.argsort(x, axis=0)  # sorts along first axis (col)    array([[0, 1],  [1, 0]])
row_idx= np.argsort(x, axis=1) # sorts along last axis (row)    array([[0, 1], [0, 1]])
for line in row_idx:
    print(line[::-1]) # max to min
# [1, 0]
# [1, 0]

Reference

numpy.argsort

相关标签
About Me
XD
Goals determine what you are going to be.
Category
标签云
CSV LeetCode v2ray Knowledge Baidu SVR Augmentation 多线程 Paddle 图形思考法 Tracking VGG-16 CLAP Llama Streamlit ONNX transformers HuggingFace Logo Use Video Firewall WebCrawler Bipartite Safetensors Docker Git BTC Linux Hilton Mixtral RGB llama.cpp Conda Data Rebuttal Search RAR PIP Python Qwen2.5 GIT Password Statistics Web Qwen2 Pickle Claude Animate Bitcoin 音频 API Math Distillation NameSilo Bert EXCEL Bin HaggingFace PyTorch Plotly FP8 TTS Gemma Domain CTC TensorRT scipy News LoRA Hungarian Google Pytorch PDF YOLO GGML 公式 版权 Freesound Jupyter 第一性原理 Vim 关于博主 SPIE hf BF16 Datetime 论文速读 VPN Quantization SAM Random XML XGBoost VSCode FP32 tqdm 签证 Quantize 算法题 多进程 LLAMA Tiktoken InvalidArgumentError Tensor UNIX Qwen Pillow Food UI Color FP64 Proxy FlashAttention Dataset GoogLeNet 净利润 icon Base64 CC DeepSeek Markdown Clash Zip SQL Attention 论文 GPTQ torchinfo ResNet-50 uwsgi Diagram Github Magnet Excel CEIR Nginx 云服务器 Disk Permission Breakpoint C++ tar Hotel 继承 Template IndexTTS2 BeautifulSoup OpenCV NLTK 顶会 FastAPI Transformers 搞笑 Website 域名 CUDA QWEN 图标 Vmess Input JSON COCO Agent AI TSV Image2Text FP16 证件照 SQLite Jetson LaTeX Anaconda Shortcut Ptyhon 阿里云 Crawler Miniforge Windows mmap 飞书 diffusers Land 报税 git logger Translation MD5 财报 DeepStream Paper Interview PyCharm Heatmap Django CAM NLP CV Numpy v0.dev Pandas 递归学习法 GPT4 LLM ChatGPT Algorithm Sklearn Card OpenAI TensorFlow OCR Review Cloudreve Plate PDB git-lfs ModelScope uWSGI Ubuntu WAN Michelin 强化学习 printf 腾讯云
站点统计

本站现有博文328篇,共被浏览838520

本站已经建立2542天!

热门文章
文章归档
回到顶部