Skip to content

Commit 2183f7b

Browse files
committed
api
1 parent 85fc5d8 commit 2183f7b

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
from .array import DecimalArray, DecimalDtype
22

33

4-
__all__ = ['DecimalArray', 'DecimalDtype']
4+
__all__ = ['DecimalArray', 'DecimalDtype', 'to_decimal', 'make_data']

pandas/tests/extension/decimal_array/array.py

+4
Original file line numberDiff line numberDiff line change
@@ -138,5 +138,9 @@ def _concat_same_type(cls, to_concat):
138138
return cls(np.concatenate([x._data for x in to_concat]))
139139

140140

141+
def to_decimal(values, context=None):
142+
return DecimalArray([decimal.Decimal(x) for x in values], context=context)
143+
144+
141145
DecimalArray._add_arithmetic_ops()
142146
DecimalArray._add_comparison_ops()

0 commit comments

Comments
 (0)