r"""Determine those values of the dataframe that are above the moving average. Parameters ---------- f : pandas.DataFrame Dataframe containing the column ``c``. c : str Name of the column in the dataframe ``f``. p : int The period of the moving averag
(f, c, p = 50)
| 51 | # |
| 52 | |
| 53 | def abovema(f, c, p = 50): |
| 54 | r"""Determine those values of the dataframe that are above the |
| 55 | moving average. |
| 56 | |
| 57 | Parameters |
| 58 | ---------- |
| 59 | f : pandas.DataFrame |
| 60 | Dataframe containing the column ``c``. |
| 61 | c : str |
| 62 | Name of the column in the dataframe ``f``. |
| 63 | p : int |
| 64 | The period of the moving average. |
| 65 | |
| 66 | Returns |
| 67 | ------- |
| 68 | new_column : pandas.Series (bool) |
| 69 | The array containing the new feature. |
| 70 | |
| 71 | """ |
| 72 | new_column = f[c] > ma(f, c, p) |
| 73 | return new_column |
| 74 | |
| 75 | |
| 76 | # |