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

本站现有博文315篇,共被浏览745846

本站已经建立2392天!

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