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

本站现有博文332篇,共被浏览875633

本站已经建立2583天!

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