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

本站现有博文321篇,共被浏览764575

本站已经建立2442天!

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