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

本站现有博文327篇,共被浏览825860

本站已经建立2532天!

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