def pchange2(f, c1, c2):
r"""Calculate the percentage change between two variables.
Parameters
----------
f : pandas.DataFrame
Dataframe containing the two columns ``c1`` and ``c2``.
c1 : str
Name of the first column in the dataframe ``f``.
c2 : str
Name of the second column in the dataframe ``f``.
Returns
-------
new_column : pandas.Series (float)
The array containing the new feature.
"""
new_column = f[c1] / f[c2] - 1.0
return new_column
#
# Function diff
#
评论列表
文章目录