package np

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file dtype.ml

1
2
3
4
5
6
7
8
9
10
let numpy = Py.import "numpy"

type t = [`Object | `S of string]
let rec to_pyobject = function
  | `S s -> Py.Module.get_function numpy "dtype" [|Py.String.of_string s|]
  | `Object -> to_pyobject (`S "object")
let of_pyobject x = match Py.Object.to_string x with
  | "object" -> `Object
  | x -> `S x

OCaml

Innovation. Community. Security.