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

本站现有博文333篇,共被浏览916215

本站已经建立2621天!

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