You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2020/09/25 15:46:19 UTC

[GitHub] [arrow] xubinlaile removed a comment on issue #8270: object of type 'init64' is not JSON serializable

xubinlaile removed a comment on issue #8270:
URL: https://github.com/apache/arrow/issues/8270#issuecomment-699003981


   
   maybe this help:
   
   
   class NpEncoder(json.JSONEncoder):
       def default(self, obj):
           if isinstance(obj, np.integer):
               return int(obj)
           elif isinstance(obj, np.floating):
               return float(obj)
           elif isinstance(obj, np.ndarray):
               return obj.tolist()
           else:
               return super(NpEncoder, self).default(obj)
   
   json.dumps(data, cls=NpEncoder) 
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org