reindex_rows_and_cols#
- caf.toolkit.pandas_utils.df_handling.reindex_rows_and_cols(df, index, columns, fill_value=nan, **kwargs)[source]#
Reindex a pandas DataFrame, making sure index/col types don’t clash.
Type checking wrapper around df.reindex(). If the type of the index or columns of df does not match the types given in index or columns, the index types will be cast to the desired types before calling the reindex.
- Parameters:
- Returns:
The given df, re-indexed to the index and columns given, including typing
- Return type:
reindexed_df