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

本站现有博文333篇,共被浏览922433

本站已经建立2628天!

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