75edd1e191f7ad38ae71bd31cba87d1faedbb6a1,talos/utils/string_cols_to_numeric.py,,string_cols_to_numeric,#Any#Any#,18
Before Change
for col in data.columns:
// avoid common non-numeric cases
if data[col].dtype != "O":
continue
if isclass(data[col][0]):
continue
if isinstance(data[col][0], FunctionType):
continue
After Change
for col in data.columns:
if data[col].apply(isnumber).sum() == len(data):
try:
data[col] = data[col].astype(int)
except ValueError:
data[col] = data[col].astype(float)
else:
data[col] = data[col]
return data
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances Project Name: autonomio/talos
Commit Name: 75edd1e191f7ad38ae71bd31cba87d1faedbb6a1
Time: 2019-02-20
Author: mailme@mikkokotila.com
File Name: talos/utils/string_cols_to_numeric.py
Class Name:
Method Name: string_cols_to_numeric
Project Name: dmlc/gluon-cv
Commit Name: 2318052dc79966bf36675606b7d992a347418292
Time: 2019-01-07
Author: cheungchih@gmail.com
File Name: scripts/detection/ssd/train_ssd.py
Class Name:
Method Name:
Project Name: hanxiao/bert-as-service
Commit Name: 6f325b9135a729a403840866fcb5248d71f54645
Time: 2018-11-13
Author: hanhxiao@tencent.com
File Name: service/server.py
Class Name: BertServer
Method Name: run