typeddfs._core_dfs

Module Contents

class typeddfs._core_dfs.CoreDf(data=None, index=None, columns=None, dtype=None, copy=False)

An abstract Pandas DataFrame subclass with additional methods.

abstract classmethod new_df(cls, **kwargs) __qualname__

Creates a new, somewhat arbitrary DataFrame of this type. Calling this with no arguments should always be supported.

Parameters

**kwargs – These should be narrowed by the overriding method as needed.

Raises
  • UnsupportedOperationError – Can be raised if a valid DataFrame is too difficult to create.

  • InvalidDfError – May be raised if the type requires specific constraints and did not overload this method to account for them. While programmers using the type should be aware of this possibility, consuming code, in general, should assume that new_df will always work.

vanilla(self) pandas.DataFrame

Makes a copy that’s a normal Pandas DataFrame.

Returns

A shallow copy with its __class__ set to pd.DataFrame

vanilla_reset(self) pandas.DataFrame

Same as vanilla(), but resets the index – but dropping the index if it has no name. This means that an effectively index-less dataframe will not end up with an extra column called β€œindex”.