Safemotion Lib
Loading...
Searching...
No Matches
Public Member Functions | List of all members
utils_os.JsonEncoder Class Reference

json 저장할 때 필요한 클래스 More...

Inheritance diagram for utils_os.JsonEncoder:

Public Member Functions

 default (self, obj)
 

Detailed Description

json 저장할 때 필요한 클래스

Definition at line 71 of file utils_os.py.

Member Function Documentation

◆ 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: