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

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

本站已经建立2600天!

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