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

本站现有博文328篇,共被浏览851081

本站已经建立2557天!

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