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

本站现有博文321篇,共被浏览774846

本站已经建立2465天!

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