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

本站现有博文324篇,共被浏览808950

本站已经建立2511天!

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