Calculations¶
Diffs¶
-
Calculations.
diffn
(diffcol: str, name: str = 'Diff')¶ Add a diff column to the main dataframe: calculate the diff from the next value
Parameters: - diffcol (str) – column to diff from
- name (str, optional) – diff column name, defaults to “Diff”
Example: ds.diffn("Col 1", "New col")
-
Calculations.
diffp
(diffcol: str, name: str = 'Diff')¶ Add a diff column to the main dataframe: calculate the diff from the previous value
Parameters: - diffcol (str) – column to diff from
- name (str, optional) – diff column name, defaults to “Diff”
Example: ds.diffp("Col 1", "New col")
-
Calculations.
diffm
(diffcol: str, name: str = 'Diff', default=nan)¶ Add a diff column to the main dataframe: calculate the diff from the column mean
Parameters: - diffcol (str) – column to diff from
- name – diff column name, defaults to “Diff”
- name – str, optional
- default – column default value, defaults to nan
- default – optional
Example: ds.diffm("Col 1", "New col")
-
Calculations.
diffs
(col: str, serie: iterable, name: str = 'Diff')¶ Add a diff column from a serie. The serie is an iterable of the same length than the dataframe
Parameters: - col (str) – column to diff
- serie (iterable) – serie to diff from
- name – name of the diff col, defaults to “Diff”
- name – str, optional
Example: ds.diffs("Col 1", [1, 1, 4], "New col")
-
Calculations.
diffsp
(col: str, serie: iterable, name: str = 'Diff')¶ Add a diff column in percentage from a serie. The serie is an iterable of the same length than the dataframe
Parameters: - col (str) – column to diff
- serie (iterable) – serie to diff from
- name – name of the diff col, defaults to “Diff”
- name – str, optional
Example: ds.diffp("Col 1", [1, 1, 4], "New col")