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

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

本站已经建立2632天!

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