package sklearn

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type tag = [
  1. | `Path
]
type t = [ `Object | `Path ] Obj.t
val of_pyobject : Py.Object.t -> t
val to_pyobject : [> tag ] Obj.t -> Py.Object.t
val create : Py.Object.t -> 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 : [> tag ] Obj.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 : [> tag ] Obj.t -> Py.Object.t

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

val as_uri : [> tag ] Obj.t -> Py.Object.t

Return the path as a 'file' URI.

val chmod : mode:Py.Object.t -> [> tag ] Obj.t -> Py.Object.t

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

val cwd : [> tag ] Obj.t -> Py.Object.t

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

val exists : [> tag ] Obj.t -> Py.Object.t

Whether this path exists.

val expanduser : [> tag ] Obj.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 -> [> tag ] Obj.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 : [> tag ] Obj.t -> Py.Object.t

Return the group name of the file gid.

val home : [> tag ] Obj.t -> Py.Object.t

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

val is_absolute : [> tag ] Obj.t -> Py.Object.t

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

val is_block_device : [> tag ] Obj.t -> Py.Object.t

Whether this path is a block device.

val is_char_device : [> tag ] Obj.t -> Py.Object.t

Whether this path is a character device.

val is_dir : [> tag ] Obj.t -> Py.Object.t

Whether this path is a directory.

val is_fifo : [> tag ] Obj.t -> Py.Object.t

Whether this path is a FIFO.

val is_file : [> tag ] Obj.t -> Py.Object.t

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

val is_mount : [> tag ] Obj.t -> Py.Object.t

Check if this path is a POSIX mount point

val is_reserved : [> tag ] Obj.t -> Py.Object.t

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

val is_socket : [> tag ] Obj.t -> Py.Object.t

Whether this path is a socket.

Whether this path is a symbolic link.

val iterdir : [> tag ] Obj.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 -> [> tag ] Obj.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 -> [> tag ] Obj.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.

Create a hard link pointing to a path named target.

val lstat : [> tag ] Obj.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 -> [> tag ] Obj.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 -> [> tag ] Obj.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 -> [> tag ] Obj.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 : [> tag ] Obj.t -> Py.Object.t

Return the login name of the file owner.

val read_bytes : [> tag ] Obj.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 -> [> tag ] Obj.t -> Py.Object.t

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

val relative_to : Py.Object.t list -> [> tag ] Obj.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 -> [> tag ] Obj.t -> Py.Object.t

Rename this path to the given path, and return a new Path instance pointing to the given path.

val replace : target:Py.Object.t -> [> tag ] Obj.t -> Py.Object.t

Rename this path to the given path, clobbering the existing destination if it exists, and return a new Path instance pointing to the given path.

val resolve : ?strict:Py.Object.t -> [> tag ] Obj.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 -> [> tag ] Obj.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 : [> tag ] Obj.t -> Py.Object.t

Remove this directory. The directory must be empty.

val samefile : other_path:Py.Object.t -> [> tag ] Obj.t -> Py.Object.t

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

val stat : [> tag ] Obj.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 -> [> tag ] Obj.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 -> [> tag ] Obj.t -> Py.Object.t

Return a new path with the file name changed.

val with_suffix : suffix:Py.Object.t -> [> tag ] Obj.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 -> [> tag ] Obj.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 -> [> tag ] Obj.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.