json 저장할 때 필요한 클래스
More...
json 저장할 때 필요한 클래스
Definition at line 71 of file utils_os.py.
◆ default()
| utils_os.JsonEncoder.default |
( |
| self, |
|
|
| obj ) |
Definition at line 72 of file utils_os.py.
72 def default(self, obj):
73 if isinstance(obj, np.integer):
74 return int(obj)
75 elif isinstance(obj, np.floating):
76 return float(obj)
77 elif isinstance(obj, np.ndarray):
78 return obj.tolist()
79 else:
80 return super(JsonEncoder, self).default(obj)
81
The documentation for this class was generated from the following file: