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

本站现有博文311篇,共被浏览741595

本站已经建立2380天!

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