anndict.utils.add_col_to_pd_df#
- anndict.utils.add_col_to_pd_df(pd_df, indices, values, new_col_name)[source]#
Adds a column to
pd_dffor given indices.- Parameters:
- pd_df
DataFrame An
DataFrame.- indices
list[int|str] |tuple[int|str,...] Array of indices where labels will be assigned.
- values
list[int|float|str|bool|Timestamp] |tuple[int|float|str|bool|Timestamp,...] Array of labels corresponding to the indices.
- new_col_name
str Name of the new column to be created in
pd_df.
- pd_df
- Return type:
None- Returns:
None
Notes
Modifies
pd_dfin-place.