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

本站现有博文320篇,共被浏览756923

本站已经建立2421天!

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