package sklearn

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type t
val of_pyobject : Py.Object.t -> t
val to_pyobject : t -> Py.Object.t
val create : ?kwargs:(string * Py.Object.t) list -> Py.Object.t list -> t

PurePath subclass that can make system calls.

Path represents a filesystem path but unlike PurePath, also offers methods to do system calls on path objects. Depending on your system, instantiating a Path will return either a PosixPath or a WindowsPath object. You can also instantiate a PosixPath or WindowsPath directly, but cannot instantiate a WindowsPath on a POSIX system or vice versa.

val absolute : t -> Py.Object.t

Return an absolute version of this path. This function works even if the path doesn't point to anything.

No normalization is done, i.e. all '.' and '..' will be kept along. Use resolve() to get the canonical path to a file.

val as_posix : t -> Py.Object.t

Return the string representation of the path with forward (/) slashes.

val as_uri : t -> Py.Object.t

Return the path as a 'file' URI.

val chmod : mode:Py.Object.t -> t -> Py.Object.t

Change the permissions of the path, like os.chmod().

val cwd : t -> Py.Object.t

Return a new path pointing to the current working directory (as returned by os.getcwd()).

val exists : t -> Py.Object.t

Whether this path exists.

val expanduser : t -> Py.Object.t

Return a new path with expanded ~ and ~user constructs (as returned by os.path.expanduser)

val glob : pattern:Py.Object.t -> t -> Py.Object.t

Iterate over this subtree and yield all existing files (of any kind, including directories) matching the given relative pattern.

val group : t -> Py.Object.t

Return the group name of the file gid.

val home : t -> Py.Object.t

Return a new path pointing to the user's home directory (as returned by os.path.expanduser('~')).

val is_absolute : t -> Py.Object.t

True if the path is absolute (has both a root and, if applicable, a drive).

val is_block_device : t -> Py.Object.t

Whether this path is a block device.

val is_char_device : t -> Py.Object.t

Whether this path is a character device.

val is_dir : t -> Py.Object.t

Whether this path is a directory.

val is_fifo : t -> Py.Object.t

Whether this path is a FIFO.

val is_file : t -> Py.Object.t

Whether this path is a regular file (also True for symlinks pointing to regular files).

val is_mount : t -> Py.Object.t

Check if this path is a POSIX mount point

val is_reserved : t -> Py.Object.t

Return True if the path contains one of the special names reserved by the system, if any.

val is_socket : t -> Py.Object.t

Whether this path is a socket.

Whether this path is a symbolic link.

val iterdir : t -> Py.Object.t

Iterate over the files in this directory. Does not yield any result for the special paths '.' and '..'.

val joinpath : Py.Object.t list -> t -> Py.Object.t

Combine this path with one or several arguments, and return a new path representing either a subpath (if all arguments are relative paths) or a totally different path (if one of the arguments is anchored).

val lchmod : mode:Py.Object.t -> t -> Py.Object.t

Like chmod(), except if the path points to a symlink, the symlink's permissions are changed, rather than its target's.

val lstat : t -> Py.Object.t

Like stat(), except if the path points to a symlink, the symlink's status information is returned, rather than its target's.

val match_ : path_pattern:Py.Object.t -> t -> Py.Object.t

Return True if this path matches the given pattern.

val mkdir : ?mode:Py.Object.t -> ?parents:Py.Object.t -> ?exist_ok:Py.Object.t -> t -> Py.Object.t

Create a new directory at this given path.

val open_ : ?mode:Py.Object.t -> ?buffering:Py.Object.t -> ?encoding:Py.Object.t -> ?errors:Py.Object.t -> ?newline:Py.Object.t -> t -> Py.Object.t

Open the file pointed by this path and return a file object, as the built-in open() function does.

val owner : t -> Py.Object.t

Return the login name of the file owner.

val read_bytes : t -> Py.Object.t

Open the file in bytes mode, read it, and close the file.

val read_text : ?encoding:Py.Object.t -> ?errors:Py.Object.t -> t -> Py.Object.t

Open the file in text mode, read it, and close the file.

val relative_to : Py.Object.t list -> t -> Py.Object.t

Return the relative path to another path identified by the passed arguments. If the operation is not possible (because this is not a subpath of the other path), raise ValueError.

val rename : target:Py.Object.t -> t -> Py.Object.t

Rename this path to the given path.

val replace : target:Py.Object.t -> t -> Py.Object.t

Rename this path to the given path, clobbering the existing destination if it exists.

val resolve : ?strict:Py.Object.t -> t -> Py.Object.t

Make the path absolute, resolving all symlinks on the way and also normalizing it (for example turning slashes into backslashes under Windows).

val rglob : pattern:Py.Object.t -> t -> Py.Object.t

Recursively yield all existing files (of any kind, including directories) matching the given relative pattern, anywhere in this subtree.

val rmdir : t -> Py.Object.t

Remove this directory. The directory must be empty.

val samefile : other_path:Py.Object.t -> t -> Py.Object.t

Return whether other_path is the same or not as this file (as returned by os.path.samefile()).

val stat : t -> Py.Object.t

Return the result of the stat() system call on this path, like os.stat() does.

Make this path a symlink pointing to the given path. Note the order of arguments (self, target) is the reverse of os.symlink's.

val touch : ?mode:Py.Object.t -> ?exist_ok:Py.Object.t -> t -> Py.Object.t

Create this file with the given access mode, if it doesn't exist.

Remove this file or link. If the path is a directory, use rmdir() instead.

val with_name : name:Py.Object.t -> t -> Py.Object.t

Return a new path with the file name changed.

val with_suffix : suffix:Py.Object.t -> t -> Py.Object.t

Return a new path with the file suffix changed. If the path has no suffix, add given suffix. If the given suffix is an empty string, remove the suffix from the path.

val write_bytes : data:Py.Object.t -> t -> Py.Object.t

Open the file in bytes mode, write to it, and close the file.

val write_text : ?encoding:Py.Object.t -> ?errors:Py.Object.t -> data:Py.Object.t -> t -> Py.Object.t

Open the file in text mode, write to it, and close the file.

val to_string : t -> string

Print the object to a human-readable representation.

val show : t -> string

Print the object to a human-readable representation.

val pp : Format.formatter -> t -> unit

Pretty-print the object to a formatter.

OCaml

Innovation. Community. Security.