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

本站现有博文327篇,共被浏览833402

本站已经建立2538天!

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