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

本站现有博文339篇,共被浏览990221次

本站已经建立2702天!

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