Skip to content

Commit

Permalink
22385: Defines to_dataframe in FeatureAttributesBase, MINOR (#336)
Browse files Browse the repository at this point in the history
While it is only implemented in the `SingleTableFeatureAttributes`
subclass, this will allow VSCode to autofill the method signature and
display the docstring.
  • Loading branch information
apbassett authored Dec 10, 2024
1 parent cca0081 commit e069f6b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions howso/utilities/feature_attributes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,20 @@ def to_json(self) -> str:
"""
return json.dumps(self)

def to_dataframe(self, *, include_all: bool = False) -> pd.DataFrame:
"""
Return a DataFrame of the feature attributes.
Among other reasons, this is useful for presenting feature attributes
in a Jupyter notebook or other medium.
Returns
-------
pandas.DataFrame
A DataFrame representation of the inferred feature attributes.
"""
return NotImplementedError('Function not yet implemented for all subclasses of `FeatureAttributesBase`')

def get_names(self, *, types: t.Optional[str | Container] = None,
without: t.Optional[Iterable[str]] = None,
) -> list[str]:
Expand Down

0 comments on commit e069f6b

Please sign in to comment.