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

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

本站已经建立2722天!

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