import numpy as np
import pandas as pd


def log_return(close: pd.Series) -> pd.Series:
    """
    Calculate log returns from a series of closing prices.

    Parameters
    ----------
    close : pd.Series
        Series of closing prices.

    Returns
    -------
    pd.Series
        Series of log returns.
    """
    return pd.Series(np.log(close.values), index=close.index).diff()


def percentage_return(close: pd.Series) -> pd.Series:
    """
    Calculate percentage returns from a series of closing prices.

    Parameters
    ----------
    close : pd.Series
        Series of closing prices.

    Returns
    -------
    pd.Series
        Series of percentage returns.
    """
    return close.pct_change()
