File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -102,16 +102,16 @@ def _vp_sample(data, sample_cnt):
102102 """
103103 Sampling data
104104 """
105- dataType = type (data ).__name__
105+ data_type = type (data ).__name__
106106 sample_cnt = len (data ) if len (data ) < sample_cnt else sample_cnt
107107
108- if dataType == 'DataFrame' :
108+ if data_type == 'DataFrame' :
109109 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' :
113113 return data [_vp_np .random .choice (data .shape [0 ], sample_cnt , replace = False )]
114- elif dataType == 'list' :
114+ elif data_type == 'list' :
115115 return _vp_rd .choices (data , k = sample_cnt )
116116 return data
117117
You can’t perform that action at this time.
0 commit comments