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

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

本站已经建立2583天!

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