You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DataFrame.describe() on a DataFrame with a span column currently doesn't work because our array types are missing the method value_counts(). The specific stack trace looks like this:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-55-f041b2b916b3> in <module>
----> 1 syntax_df.describe()
[...]
~/opt/miniconda3/envs/pd/lib/python3.7/site-packages/pandas/core/algorithms.py in value_counts(values, sort, ascending, normalize, bins, dropna)
736
737 # handle Categorical and sparse,
--> 738 result = Series(values)._values.value_counts(dropna=dropna)
739 result.name = name
740 counts = result._values
AttributeError: 'CharSpanArray' object has no attribute 'value_counts'
We should implement the value_counts() method, following the example of the implementation for Pandas' built-in IntervalArray type.
Note that TokenSpanArray is currently a subclass of CharSpanArray, but the implementation of #91 may change that relationship.
The text was updated successfully, but these errors were encountered:
frreiss
changed the title
Add value_counts() method to CharSpanArray to support DataFrame.describe()
Add value_counts() method to SpanArray to support DataFrame.describe()
Jun 14, 2021
DataFrame.describe()
on a DataFrame with a span column currently doesn't work because our array types are missing the methodvalue_counts()
. The specific stack trace looks like this:We should implement the
value_counts()
method, following the example of the implementation for Pandas' built-inIntervalArray
type.Note that
TokenSpanArray
is currently a subclass ofCharSpanArray
, but the implementation of #91 may change that relationship.The text was updated successfully, but these errors were encountered: