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

本站现有博文332篇,共被浏览870629

本站已经建立2579天!

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