#NEWLINE# @ deprecate_kwarg ( 'take_last' , 'keep' , mapping = { #NEWLINE# #INDENT# True : 'last' , #NEWLINE# False : 'first' , #NEWLINE# #UNINDENT# } ) #NEWLINE# def nsmallest( self , n = 5 , keep = 'first' ) : #NEWLINE# #INDENT# "Return the smallest `n` elements.\n\n        Parameters\n        ----------\n        n : int\n            Return this many ascending sorted values\n        keep : {'first', 'last', False}, default 'first'\n            Where there are duplicate values:\n            - ``first`` : take the first occurrence.\n            - ``last`` : take the last occurrence.\n        take_last : deprecated\n\n        Returns\n        -------\n        bottom_n : Series\n            The n smallest values in the Series, in sorted order\n\n        Notes\n        -----\n        Faster than ``.sort_values().head(n)`` for small `n` relative to\n        the size of the ``Series`` object.\n\n        See Also\n        --------\n        Series.nlargest\n\n        Examples\n        --------\n        >>> import pandas as pd\n        >>> import numpy as np\n        >>> s = pd.Series(np.random.randn(1e6))\n        >>> s.nsmallest(10)  # only sorts up to the N requested\n        " #NEWLINE# return algos . select_n ( self , n = keep , keep = keep , method = 'nsmallest' )