{
    "nbformat": 4,
    "nbformat_minor": 5,
    "metadata": {
        "kernelspec": {
            "display_name": "Python",
            "language": "python",
            "name": "python"
        },
        "language_info": {
            "name": "python"
        }
    },
    "cells": [
        {
            "id": "e625d846",
            "cell_type": "markdown",
            "source": "<div class='alert alert-warning'>\n\nSciPy's interactive examples with Jupyterlite are experimental and may not always work as expected. Execution of cells containing imports may result in large downloads (up to 60MB of content for the first import from SciPy). Load times when importing from SciPy may take roughly 10-20 seconds. If you notice any problems, feel free to open an [issue](https://github.com/scipy/scipy/issues/new/choose).\n\n</div>",
            "metadata": {}
        },
        {
            "id": "87fd653d",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "import numpy as np\nfrom scipy.stats import rankdata\nrankdata([0, 2, 3, 2])",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "array([ 1. ,  2.5,  4. ,  2.5])"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "075c1c50",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "rankdata([0, 2, 3, 2], method='min')",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "array([ 1,  2,  4,  2])"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "f83beaca",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "rankdata([0, 2, 3, 2], method='max')",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "array([ 1,  3,  4,  3])"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "54551270",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "rankdata([0, 2, 3, 2], method='dense')",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "array([ 1,  2,  3,  2])"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "b0083ee5",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "rankdata([0, 2, 3, 2], method='ordinal')",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "array([ 1,  2,  4,  3])"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "3390751b",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "rankdata([[0, 2], [3, 2]]).reshape(2,2)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "array([[1. , 2.5],\n      [4. , 2.5]])"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "86f807bc",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "rankdata([[0, 2, 2], [3, 2, 5]], axis=1)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "array([[1. , 2.5, 2.5],\n       [2. , 1. , 3. ]])"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "1ce4622e",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "rankdata([0, 2, 3, np.nan, -2, np.nan], nan_policy=\"propagate\")",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "array([nan, nan, nan, nan, nan, nan])"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "d07e71e0",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "rankdata([0, 2, 3, np.nan, -2, np.nan], nan_policy=\"omit\")",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "array([ 2.,  3.,  4., nan,  1., nan])"
                    },
                    "execution_count": null
                }
            ]
        }
    ]
}