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

本站现有博文322篇,共被浏览787907

本站已经建立2482天!

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