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

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

本站已经建立2557天!

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