File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -65,18 +65,17 @@ def __init__(
65
65
def from_subscriptable (subscriptable ) -> Dataset :
66
66
'''
67
67
Create ``Dataset`` based on subscriptable i.e. implements
68
- ``__get_item__`` . Should only be used for simple examples as a
69
- ``Dataset`` created with this method does not support methods that
70
- require a source dataframe (i.e. :func:`Dataset.split` and
71
- :func:`Dataset.subset`)
68
+ ``__getitem__`` and ``__len__`` . Should only be used for simple
69
+ examples as a ``Dataset`` created with this method does not support
70
+ methods that require a source dataframe (i.e. :func:`` Dataset.split``
71
+ and :func:`` Dataset.subset` `)
72
72
'''
73
+
73
74
return (
74
75
Dataset .from_dataframe (
75
- pd .DataFrame (dict (
76
- example = subscriptable
77
- ))
76
+ pd .DataFrame (dict (index = range (len (subscriptable ))))
78
77
)
79
- .map (lambda row : row ['example' ])
78
+ .map (lambda row : subscriptable [ row ['index' ] ])
80
79
)
81
80
82
81
@staticmethod
You can’t perform that action at this time.
0 commit comments