File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -102,16 +102,16 @@ def _vp_sample(data, sample_cnt):
102
102
"""
103
103
Sampling data
104
104
"""
105
- dataType = type (data ).__name__
105
+ data_type = type (data ).__name__
106
106
sample_cnt = len (data ) if len (data ) < sample_cnt else sample_cnt
107
107
108
- if dataType == 'DataFrame' :
108
+ if data_type == 'DataFrame' :
109
109
return data .sample (sample_cnt , random_state = 0 )
110
- elif dataType == 'Series' :
111
- return data .sample (sample_cnt , random_state = 0 )
112
- elif dataType == 'ndarray' :
110
+ elif data_type == 'Series' :
111
+ return data .sample (sample_cnt , random_state = 0 ). reset_index ( drop = True )
112
+ elif data_type == 'ndarray' :
113
113
return data [_vp_np .random .choice (data .shape [0 ], sample_cnt , replace = False )]
114
- elif dataType == 'list' :
114
+ elif data_type == 'list' :
115
115
return _vp_rd .choices (data , k = sample_cnt )
116
116
return data
117
117
You can’t perform that action at this time.
0 commit comments