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

本站现有博文340篇,共被浏览1019322次

本站已经建立2719天!

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