* Returns the year, in local time * @example * ``` * import { Series } from "danfojs-node" * const data = [ * "2019-01-01", * "2019-02-01", * "2021-03-01", * "2020-04-01", * ] * const df = new Series(data) * const year = df.dt.year() * cons
()
| 103 | * ``` |
| 104 | */ |
| 105 | year() { |
| 106 | const newValues = this.$dateObjectArray.map(date => date.getFullYear()) |
| 107 | return new Series(newValues); |
| 108 | } |
| 109 | |
| 110 | /** |
| 111 | * Returns the name of the month, in local time |