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

本站现有博文323篇,共被浏览795919

本站已经建立2493天!

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