doc_content
stringlengths
1
386k
doc_id
stringlengths
5
188
sklearn.utils.estimator_checks.check_estimator(Estimator, generate_only=False) [source] Check if estimator adheres to scikit-learn conventions. This estimator will run an extensive test-suite for input validation, shapes, etc, making sure that the estimator complies with scikit-learn conventions as detailed in Rollin...
sklearn.modules.generated.sklearn.utils.estimator_checks.check_estimator#sklearn.utils.estimator_checks.check_estimator
sklearn.utils.estimator_checks.parametrize_with_checks(estimators) [source] Pytest specific decorator for parametrizing estimator checks. The id of each check is set to be a pprint version of the estimator and the name of the check with its keyword arguments. This allows to use pytest -k to specify which tests to run...
sklearn.modules.generated.sklearn.utils.estimator_checks.parametrize_with_checks#sklearn.utils.estimator_checks.parametrize_with_checks
sklearn.utils.estimator_html_repr(estimator) [source] Build a HTML representation of an estimator. Read more in the User Guide. Parameters estimatorestimator object The estimator to visualize. Returns html: str HTML representation of estimator.
sklearn.modules.generated.sklearn.utils.estimator_html_repr#sklearn.utils.estimator_html_repr
sklearn.utils.extmath.density(w, **kwargs) [source] Compute density of a sparse vector. Parameters warray-like The sparse vector. Returns float The density of w, between 0 and 1.
sklearn.modules.generated.sklearn.utils.extmath.density#sklearn.utils.extmath.density
sklearn.utils.extmath.fast_logdet(A) [source] Compute log(det(A)) for A symmetric. Equivalent to : np.log(nl.det(A)) but more robust. It returns -Inf if det(A) is non positive or is not defined. Parameters Aarray-like The matrix.
sklearn.modules.generated.sklearn.utils.extmath.fast_logdet#sklearn.utils.extmath.fast_logdet
sklearn.utils.extmath.randomized_range_finder(A, *, size, n_iter, power_iteration_normalizer='auto', random_state=None) [source] Computes an orthonormal matrix whose range approximates the range of A. Parameters A2D array The input data matrix. sizeint Size of the return array. n_iterint Number of power...
sklearn.modules.generated.sklearn.utils.extmath.randomized_range_finder#sklearn.utils.extmath.randomized_range_finder
sklearn.utils.extmath.randomized_svd(M, n_components, *, n_oversamples=10, n_iter='auto', power_iteration_normalizer='auto', transpose='auto', flip_sign=True, random_state=0) [source] Computes a truncated randomized SVD. Parameters M{ndarray, sparse matrix} Matrix to decompose. n_componentsint Number of sin...
sklearn.modules.generated.sklearn.utils.extmath.randomized_svd#sklearn.utils.extmath.randomized_svd
sklearn.utils.extmath.safe_sparse_dot(a, b, *, dense_output=False) [source] Dot product that handle the sparse matrix case correctly. Parameters a{ndarray, sparse matrix} b{ndarray, sparse matrix} dense_outputbool, default=False When False, a and b both being sparse will yield sparse output. When True, outp...
sklearn.modules.generated.sklearn.utils.extmath.safe_sparse_dot#sklearn.utils.extmath.safe_sparse_dot
sklearn.utils.extmath.weighted_mode(a, w, *, axis=0) [source] Returns an array of the weighted modal (most common) value in a. If there is more than one such value, only the first is returned. The bin-count for the modal bins is also returned. This is an extension of the algorithm in scipy.stats.mode. Parameters ...
sklearn.modules.generated.sklearn.utils.extmath.weighted_mode#sklearn.utils.extmath.weighted_mode
sklearn.utils.gen_even_slices(n, n_packs, *, n_samples=None) [source] Generator to create n_packs slices going up to n. Parameters nint n_packsint Number of slices to generate. n_samplesint, default=None Number of samples. Pass n_samples when the slices are to be used for sparse matrix indexing; slicing o...
sklearn.modules.generated.sklearn.utils.gen_even_slices#sklearn.utils.gen_even_slices
sklearn.utils.graph.single_source_shortest_path_length(graph, source, *, cutoff=None) [source] Return the shortest path length from source to all reachable nodes. Returns a dictionary of shortest path lengths keyed by target. Parameters graph{sparse matrix, ndarray} of shape (n, n) Adjacency matrix of the graph...
sklearn.modules.generated.sklearn.utils.graph.single_source_shortest_path_length#sklearn.utils.graph.single_source_shortest_path_length
sklearn.utils.graph_shortest_path.graph_shortest_path() Perform a shortest-path graph search on a positive directed or undirected graph. Parameters dist_matrixarraylike or sparse matrix, shape = (N,N) Array of positive distances. If vertex i is connected to vertex j, then dist_matrix[i,j] gives the distance bet...
sklearn.modules.generated.sklearn.utils.graph_shortest_path.graph_shortest_path#sklearn.utils.graph_shortest_path.graph_shortest_path
sklearn.utils.indexable(*iterables) [source] Make arrays indexable for cross-validation. Checks consistent length, passes through None, and ensures that everything can be indexed by converting sparse matrices to csr and converting non-interable objects to arrays. Parameters *iterables{lists, dataframes, ndarrays,...
sklearn.modules.generated.sklearn.utils.indexable#sklearn.utils.indexable
sklearn.utils.metaestimators.if_delegate_has_method(delegate) [source] Create a decorator for methods that are delegated to a sub-estimator This enables ducktyping by hasattr returning True according to the sub-estimator. Parameters delegatestring, list of strings or tuple of strings Name of the sub-estimator t...
sklearn.modules.generated.sklearn.utils.metaestimators.if_delegate_has_method#sklearn.utils.metaestimators.if_delegate_has_method
sklearn.utils.multiclass.is_multilabel(y) [source] Check if y is in a multilabel format. Parameters yndarray of shape (n_samples,) Target values. Returns outbool Return True, if y is in a multilabel format, else `False. Examples >>> import numpy as np >>> from sklearn.utils.multiclass import is_mult...
sklearn.modules.generated.sklearn.utils.multiclass.is_multilabel#sklearn.utils.multiclass.is_multilabel
sklearn.utils.multiclass.type_of_target(y) [source] Determine the type of data indicated by the target. Note that this type is the most specific type that can be inferred. For example: binary is more specific but compatible with multiclass. multiclass of integers is more specific but compatible with continuous. m...
sklearn.modules.generated.sklearn.utils.multiclass.type_of_target#sklearn.utils.multiclass.type_of_target
sklearn.utils.multiclass.unique_labels(*ys) [source] Extract an ordered array of unique labels. We don’t allow: mix of multilabel and multiclass (single label) targets mix of label indicator matrix and anything else, because there are no explicit labels) mix of label indicator matrices of different sizes mix of st...
sklearn.modules.generated.sklearn.utils.multiclass.unique_labels#sklearn.utils.multiclass.unique_labels
sklearn.utils.murmurhash3_32() Compute the 32bit murmurhash3 of key at seed. The underlying implementation is MurmurHash3_x86_32 generating low latency 32bits hash suitable for implementing lookup tables, Bloom filters, count min sketch or feature hashing. Parameters keynp.int32, bytes, unicode or ndarray of dtyp...
sklearn.modules.generated.sklearn.utils.murmurhash3_32#sklearn.utils.murmurhash3_32
sklearn.utils.parallel_backend(backend, n_jobs=- 1, inner_max_num_threads=None, **backend_params) [source] Change the default backend used by Parallel inside a with block. If backend is a string it must match a previously registered implementation using the register_parallel_backend function. By default the following...
sklearn.modules.generated.sklearn.utils.parallel_backend#sklearn.utils.parallel_backend
sklearn.utils.random.sample_without_replacement() Sample integers without replacement. Select n_samples integers from the set [0, n_population) without replacement. Parameters n_populationint The size of the set to sample from. n_samplesint The number of integer to sample. random_stateint, RandomState ins...
sklearn.modules.generated.sklearn.utils.random.sample_without_replacement#sklearn.utils.random.sample_without_replacement
sklearn.utils.register_parallel_backend(name, factory, make_default=False) [source] Register a new Parallel backend factory. The new backend can then be selected by passing its name as the backend argument to the Parallel class. Moreover, the default backend can be overwritten globally by setting make_default=True. T...
sklearn.modules.generated.sklearn.utils.register_parallel_backend#sklearn.utils.register_parallel_backend
sklearn.utils.resample(*arrays, replace=True, n_samples=None, random_state=None, stratify=None) [source] Resample arrays or sparse matrices in a consistent way. The default strategy implements one step of the bootstrapping procedure. Parameters *arrayssequence of array-like of shape (n_samples,) or (n_samples, n_...
sklearn.modules.generated.sklearn.utils.resample#sklearn.utils.resample
sklearn.utils.safe_mask(X, mask) [source] Return a mask which is safe to use on X. Parameters X{array-like, sparse matrix} Data on which to apply mask. maskndarray Mask to be used on X. Returns mask
sklearn.modules.generated.sklearn.utils.safe_mask#sklearn.utils.safe_mask
sklearn.utils.safe_sqr(X, *, copy=True) [source] Element wise squaring of array-likes and sparse matrices. Parameters X{array-like, ndarray, sparse matrix} copybool, default=True Whether to create a copy of X and operate on it or to perform inplace computation (default behaviour). Returns X ** 2element ...
sklearn.modules.generated.sklearn.utils.safe_sqr#sklearn.utils.safe_sqr
sklearn.utils.shuffle(*arrays, random_state=None, n_samples=None) [source] Shuffle arrays or sparse matrices in a consistent way. This is a convenience alias to resample(*arrays, replace=False) to do random permutations of the collections. Parameters *arrayssequence of indexable data-structures Indexable data-s...
sklearn.modules.generated.sklearn.utils.shuffle#sklearn.utils.shuffle
sklearn.utils.sparsefuncs.incr_mean_variance_axis(X, *, axis, last_mean, last_var, last_n, weights=None) [source] Compute incremental mean and variance along an axis on a CSR or CSC matrix. last_mean, last_var are the statistics computed at the last step by this function. Both must be initialized to 0-arrays of the p...
sklearn.modules.generated.sklearn.utils.sparsefuncs.incr_mean_variance_axis#sklearn.utils.sparsefuncs.incr_mean_variance_axis
sklearn.utils.sparsefuncs.inplace_column_scale(X, scale) [source] Inplace column scaling of a CSC/CSR matrix. Scale each feature of the data matrix by multiplying with specific scale provided by the caller assuming a (n_samples, n_features) shape. Parameters Xsparse matrix of shape (n_samples, n_features) Matri...
sklearn.modules.generated.sklearn.utils.sparsefuncs.inplace_column_scale#sklearn.utils.sparsefuncs.inplace_column_scale
sklearn.utils.sparsefuncs.inplace_csr_column_scale(X, scale) [source] Inplace column scaling of a CSR matrix. Scale each feature of the data matrix by multiplying with specific scale provided by the caller assuming a (n_samples, n_features) shape. Parameters Xsparse matrix of shape (n_samples, n_features) Matri...
sklearn.modules.generated.sklearn.utils.sparsefuncs.inplace_csr_column_scale#sklearn.utils.sparsefuncs.inplace_csr_column_scale
sklearn.utils.sparsefuncs.inplace_row_scale(X, scale) [source] Inplace row scaling of a CSR or CSC matrix. Scale each row of the data matrix by multiplying with specific scale provided by the caller assuming a (n_samples, n_features) shape. Parameters Xsparse matrix of shape (n_samples, n_features) Matrix to be...
sklearn.modules.generated.sklearn.utils.sparsefuncs.inplace_row_scale#sklearn.utils.sparsefuncs.inplace_row_scale
sklearn.utils.sparsefuncs.inplace_swap_column(X, m, n) [source] Swaps two columns of a CSC/CSR matrix in-place. Parameters Xsparse matrix of shape (n_samples, n_features) Matrix whose two columns are to be swapped. It should be of CSR or CSC format. mint Index of the column of X to be swapped. nint Inde...
sklearn.modules.generated.sklearn.utils.sparsefuncs.inplace_swap_column#sklearn.utils.sparsefuncs.inplace_swap_column
sklearn.utils.sparsefuncs.inplace_swap_row(X, m, n) [source] Swaps two rows of a CSC/CSR matrix in-place. Parameters Xsparse matrix of shape (n_samples, n_features) Matrix whose two rows are to be swapped. It should be of CSR or CSC format. mint Index of the row of X to be swapped. nint Index of the row...
sklearn.modules.generated.sklearn.utils.sparsefuncs.inplace_swap_row#sklearn.utils.sparsefuncs.inplace_swap_row
sklearn.utils.sparsefuncs.mean_variance_axis(X, axis, weights=None, return_sum_weights=False) [source] Compute mean and variance along an axis on a CSR or CSC matrix. Parameters Xsparse matrix of shape (n_samples, n_features) Input data. It can be of CSR or CSC format. axis{0, 1} Axis along which the axis s...
sklearn.modules.generated.sklearn.utils.sparsefuncs.mean_variance_axis#sklearn.utils.sparsefuncs.mean_variance_axis
sklearn.utils.sparsefuncs_fast.inplace_csr_row_normalize_l1() Inplace row normalize using the l1 norm
sklearn.modules.generated.sklearn.utils.sparsefuncs_fast.inplace_csr_row_normalize_l1#sklearn.utils.sparsefuncs_fast.inplace_csr_row_normalize_l1
sklearn.utils.sparsefuncs_fast.inplace_csr_row_normalize_l2() Inplace row normalize using the l2 norm
sklearn.modules.generated.sklearn.utils.sparsefuncs_fast.inplace_csr_row_normalize_l2#sklearn.utils.sparsefuncs_fast.inplace_csr_row_normalize_l2
sklearn.utils.validation.check_is_fitted(estimator, attributes=None, *, msg=None, all_or_any=<built-in function all>) [source] Perform is_fitted validation for estimator. Checks if the estimator is fitted by verifying the presence of fitted attributes (ending with a trailing underscore) and otherwise raises a NotFitt...
sklearn.modules.generated.sklearn.utils.validation.check_is_fitted#sklearn.utils.validation.check_is_fitted
sklearn.utils.validation.check_memory(memory) [source] Check that memory is joblib.Memory-like. joblib.Memory-like means that memory can be converted into a joblib.Memory instance (typically a str denoting the location) or has the same interface (has a cache method). Parameters memoryNone, str or object with the ...
sklearn.modules.generated.sklearn.utils.validation.check_memory#sklearn.utils.validation.check_memory
sklearn.utils.validation.check_symmetric(array, *, tol=1e-10, raise_warning=True, raise_exception=False) [source] Make sure that array is 2D, square and symmetric. If the array is not symmetric, then a symmetrized version is returned. Optionally, a warning or exception is raised if the matrix is not symmetric. Param...
sklearn.modules.generated.sklearn.utils.validation.check_symmetric#sklearn.utils.validation.check_symmetric
sklearn.utils.validation.column_or_1d(y, *, warn=False) [source] Ravel column or 1d numpy array, else raises an error. Parameters yarray-like warnbool, default=False To control display of warnings. Returns yndarray
sklearn.modules.generated.sklearn.utils.validation.column_or_1d#sklearn.utils.validation.column_or_1d
sklearn.utils.validation.has_fit_parameter(estimator, parameter) [source] Checks whether the estimator’s fit method supports the given parameter. Parameters estimatorobject An estimator to inspect. parameterstr The searched parameter. Returns is_parameter: bool Whether the parameter was found to be a ...
sklearn.modules.generated.sklearn.utils.validation.has_fit_parameter#sklearn.utils.validation.has_fit_parameter
sklearn.utils._safe_indexing(X, indices, *, axis=0) [source] Return rows, items or columns of X using indices. Warning This utility is documented, but private. This means that backward compatibility might be broken without any deprecation cycle. Parameters Xarray-like, sparse-matrix, list, pandas.DataFrame, pan...
sklearn.modules.generated.sklearn.utils._safe_indexing#sklearn.utils._safe_indexing
pygame._sdl2.touch pygame module to work with touch input New in pygame 2: This module requires SDL2. pygame._sdl2.touch.get_num_devices() get the number of touch devices get_num_devices() -> int Return the number of available touch devices. pygame._sdl2.touch.get_device() get the a touch device id fo...
pygame.ref.touch
pygame._sdl2.touch.get_device() get the a touch device id for a given index get_device(index) -> touchid Parameters: index (int) -- This number is at least 0 and less than the number of devices. Return an integer id associated with the given index.
pygame.ref.touch#pygame._sdl2.touch.get_device
pygame._sdl2.touch.get_finger() get information about an active finger get_finger(touchid, index) -> int Parameters: touchid (int) -- The touch device id. index (int) -- The index of the finger to return information about, between 0 and the number of active fingers. Return a dict for the finger index a...
pygame.ref.touch#pygame._sdl2.touch.get_finger
pygame._sdl2.touch.get_num_devices() get the number of touch devices get_num_devices() -> int Return the number of available touch devices.
pygame.ref.touch#pygame._sdl2.touch.get_num_devices
pygame._sdl2.touch.get_num_fingers() the number of active fingers for a given touch device get_num_fingers(touchid) -> int Return the number of fingers active for the touch device whose id is touchid.
pygame.ref.touch#pygame._sdl2.touch.get_num_fingers
pygame.BufferProxy pygame object to export a surface buffer through an array protocol BufferProxy(<parent>) -> BufferProxy BufferProxy is a pygame support type, designed as the return value of the Surface.get_buffer() and Surface.get_view() methods. For all Python versions a BufferProxy object exports a C struct a...
pygame.ref.bufferproxy
length The size, in bytes, of the exported buffer. length -> int The number of valid bytes of data exported. For discontinuous data, that is data which is not a single block of memory, the bytes within the gaps are excluded from the count. This property is equivalent to the Py_buffer C struct len field.
pygame.ref.bufferproxy#pygame.BufferProxy.length
parent Return wrapped exporting object. parent -> Surface parent -> <parent> The Surface which returned the BufferProxy object or the object passed to a BufferProxy call.
pygame.ref.bufferproxy#pygame.BufferProxy.parent
raw A copy of the exported buffer as a single block of bytes. raw -> bytes The buffer data as a str/bytes object. Any gaps in the exported data are removed.
pygame.ref.bufferproxy#pygame.BufferProxy.raw
write() Write raw bytes to object buffer. write(buffer, offset=0) Overwrite bytes in the parent object's data. The data must be C or F contiguous, otherwise a ValueError is raised. Argument buffer is a str/bytes object. An optional offset gives a start position, in bytes, within the buffer where overwriting begins. ...
pygame.ref.bufferproxy#pygame.BufferProxy.write
pygame.camera pygame module for camera use Pygame currently supports only Linux and v4l2 cameras. EXPERIMENTAL!: This API may change or disappear in later pygame releases. If you use this, your code will very likely break with the next pygame release. The Bayer to RGB function is based on: Sonix SN9C101 based webc...
pygame.ref.camera
pygame.camera.Camera load a camera Camera(device, (width, height), format) -> Camera Loads a v4l2 camera. The device is typically something like "/dev/video0". Default width and height are 640 by 480. Format is the desired colorspace of the output. This is useful for computer vision purposes. The default is RGB. The...
pygame.ref.camera#pygame.camera.Camera
get_controls() gets current values of user controls get_controls() -> (hflip = bool, vflip = bool, brightness) If the camera supports it, get_controls will return the current settings for horizontal and vertical image flip as bools and brightness as an int. If unsupported, it will return the default values of (0, 0,...
pygame.ref.camera#pygame.camera.Camera.get_controls
get_image() captures an image as a Surface get_image(Surface = None) -> Surface Pulls an image off of the buffer as an RGB Surface. It can optionally reuse an existing Surface to save time. The bit-depth of the surface is either 24 bits or the same as the optionally supplied Surface.
pygame.ref.camera#pygame.camera.Camera.get_image
get_raw() returns an unmodified image as a string get_raw() -> string Gets an image from a camera as a string in the native pixelformat of the camera. Useful for integration with other libraries.
pygame.ref.camera#pygame.camera.Camera.get_raw
get_size() returns the dimensions of the images being recorded get_size() -> (width, height) Returns the current dimensions of the images being captured by the camera. This will return the actual size, which may be different than the one specified during initialization if the camera did not support that size.
pygame.ref.camera#pygame.camera.Camera.get_size
query_image() checks if a frame is ready query_image() -> bool If an image is ready to get, it returns true. Otherwise it returns false. Note that some webcams will always return False and will only queue a frame when called with a blocking function like get_image(). This is useful to separate the framerate of the g...
pygame.ref.camera#pygame.camera.Camera.query_image
set_controls() changes camera settings if supported by the camera set_controls(hflip = bool, vflip = bool, brightness) -> (hflip = bool, vflip = bool, brightness) Allows you to change camera settings if the camera supports it. The return values will be the input values if the camera claims it succeeded or the values...
pygame.ref.camera#pygame.camera.Camera.set_controls
start() opens, initializes, and starts capturing start() -> None Opens the camera device, attempts to initialize it, and begins recording images to a buffer. The camera must be started before any of the below functions can be used.
pygame.ref.camera#pygame.camera.Camera.start
stop() stops, uninitializes, and closes the camera stop() -> None Stops recording, uninitializes the camera, and closes it. Once a camera is stopped, the below functions cannot be used until it is started again.
pygame.ref.camera#pygame.camera.Camera.stop
pygame.camera.colorspace() Surface colorspace conversion colorspace(Surface, format, DestSurface = None) -> Surface Allows for conversion from "RGB" to a destination colorspace of "HSV" or "YUV". The source and destination surfaces must be the same size and pixel depth. This is useful for computer vision on devices ...
pygame.ref.camera#pygame.camera.colorspace
pygame.camera.list_cameras() returns a list of available cameras list_cameras() -> [cameras] Checks the computer for available cameras and returns a list of strings of camera names, ready to be fed into pygame.camera.Camera.
pygame.ref.camera#pygame.camera.list_cameras
pygame.cdrom pygame module for audio cdrom control The cdrom module manages the CD and DVD drives on a computer. It can also control the playback of audio CDs. This module needs to be initialized before it can do anything. Each CD object you create represents a cdrom drive and must also be initialized individually...
pygame.ref.cdrom
pygame.cdrom.CD class to manage a cdrom drive CD(id) -> CD You can create a CD object for each cdrom on the system. Use pygame.cdrom.get_count() to determine how many drives actually exist. The id argument is an integer of the drive, starting at zero. The CD object is not initialized, you can only call CD.get_id() a...
pygame.ref.cdrom#pygame.cdrom.CD
eject() eject or open the cdrom drive eject() -> None This will open the cdrom drive and eject the cdrom. If the drive is playing or paused it will be stopped.
pygame.ref.cdrom#pygame.cdrom.CD.eject
get_all() get all track information get_all() -> [(audio, start, end, length), ...] Return a list with information for every track on the cdrom. The information consists of a tuple with four values. The audio value is True if the track contains audio data. The start, end, and length values are floating point numbers...
pygame.ref.cdrom#pygame.cdrom.CD.get_all
get_busy() true if the drive is playing audio get_busy() -> bool Returns True if the drive busy playing back audio.
pygame.ref.cdrom#pygame.cdrom.CD.get_busy
get_current() the current audio playback position get_current() -> track, seconds Returns both the current track and time of that track. This method works when the drive is either playing or paused. Note, track 0 is the first track on the CD. Track numbers start at zero.
pygame.ref.cdrom#pygame.cdrom.CD.get_current
get_empty() False if a cdrom is in the drive get_empty() -> bool Return False if there is a cdrom currently in the drive. If the drive is empty this will return True.
pygame.ref.cdrom#pygame.cdrom.CD.get_empty
get_id() the index of the cdrom drive get_id() -> id Returns the integer id that was used to create the CD instance. This method can work on an uninitialized CD.
pygame.ref.cdrom#pygame.cdrom.CD.get_id
get_init() true if this cd device initialized get_init() -> bool Test if this CDROM device is initialized. This is different than the pygame.cdrom.init() since each drive must also be initialized individually.
pygame.ref.cdrom#pygame.cdrom.CD.get_init
get_name() the system name of the cdrom drive get_name() -> name Return the string name of the drive. This is the system name used to represent the drive. It is often the drive letter or device name. This method can work on an uninitialized CD.
pygame.ref.cdrom#pygame.cdrom.CD.get_name
get_numtracks() the number of tracks on the cdrom get_numtracks() -> count Return the number of tracks on the cdrom in the drive. This will return zero of the drive is empty or has no tracks.
pygame.ref.cdrom#pygame.cdrom.CD.get_numtracks
get_paused() true if the drive is paused get_paused() -> bool Returns True if the drive is currently paused.
pygame.ref.cdrom#pygame.cdrom.CD.get_paused
get_track_audio() true if the cdrom track has audio data get_track_audio(track) -> bool Determine if a track on a cdrom contains audio data. You can also call CD.num_tracks() and CD.get_all() to determine more information about the cdrom. Note, track 0 is the first track on the CD. Track numbers start at zero.
pygame.ref.cdrom#pygame.cdrom.CD.get_track_audio
get_track_length() length of a cdrom track get_track_length(track) -> seconds Return a floating point value in seconds of the length of the cdrom track. Note, track 0 is the first track on the CD. Track numbers start at zero.
pygame.ref.cdrom#pygame.cdrom.CD.get_track_length
get_track_start() start time of a cdrom track get_track_start(track) -> seconds Return the absolute time in seconds where at start of the cdrom track. Note, track 0 is the first track on the CD. Track numbers start at zero.
pygame.ref.cdrom#pygame.cdrom.CD.get_track_start
init() initialize a cdrom drive for use init() -> None Initialize the cdrom drive for use. The drive must be initialized for most CD methods to work. Even if the rest of pygame has been initialized. There may be a brief pause while the drive is initialized. Avoid CD.init() if the program should not stop for a second...
pygame.ref.cdrom#pygame.cdrom.CD.init
pause() temporarily stop audio playback pause() -> None Temporarily stop audio playback on the CD. The playback can be resumed at the same point with the CD.resume() method. If the CD is not playing this method does nothing. Note, track 0 is the first track on the CD. Track numbers start at zero.
pygame.ref.cdrom#pygame.cdrom.CD.pause
play() start playing audio play(track, start=None, end=None) -> None Playback audio from an audio cdrom in the drive. Besides the track number argument, you can also pass a starting and ending time for playback. The start and end time are in seconds, and can limit the section of an audio track played. If you pass a ...
pygame.ref.cdrom#pygame.cdrom.CD.play
quit() uninitialize a cdrom drive for use quit() -> None Uninitialize a drive for use. Call this when your program will not be accessing the drive for awhile.
pygame.ref.cdrom#pygame.cdrom.CD.quit
resume() unpause audio playback resume() -> None Unpause a paused CD. If the CD is not paused or already playing, this method does nothing.
pygame.ref.cdrom#pygame.cdrom.CD.resume
stop() stop audio playback stop() -> None Stops playback of audio from the cdrom. This will also lose the current playback position. This method does nothing if the drive isn't already playing audio.
pygame.ref.cdrom#pygame.cdrom.CD.stop
pygame.cdrom.get_count() number of cd drives on the system get_count() -> count Return the number of cd drives on the system. When you create CD objects you need to pass an integer id that must be lower than this count. The count will be 0 if there are no drives on the system.
pygame.ref.cdrom#pygame.cdrom.get_count
pygame.cdrom.get_init() true if the cdrom module is initialized get_init() -> bool Test if the cdrom module is initialized or not. This is different than the CD.init() since each drive must also be initialized individually.
pygame.ref.cdrom#pygame.cdrom.get_init
pygame.cdrom.init() initialize the cdrom module init() -> None Initialize the cdrom module. This will scan the system for all CD devices. The module must be initialized before any other functions will work. This automatically happens when you call pygame.init(). It is safe to call this function more than once.
pygame.ref.cdrom#pygame.cdrom.init
pygame.cdrom.quit() uninitialize the cdrom module quit() -> None Uninitialize the cdrom module. After you call this any existing CD objects will no longer work. It is safe to call this function more than once.
pygame.ref.cdrom#pygame.cdrom.quit
pygame.Color pygame object for color representations Color(r, g, b) -> Color Color(r, g, b, a=255) -> Color Color(color_value) -> Color The Color class represents RGBA color values using a value range of 0 to 255 inclusive. It allows basic arithmetic operations — binary operations +, -, *, //, %, and unary operati...
pygame.ref.color
a Gets or sets the alpha value of the Color. a -> int The alpha value of the Color.
pygame.ref.color#pygame.Color.a
b Gets or sets the blue value of the Color. b -> int The blue value of the Color.
pygame.ref.color#pygame.Color.b
cmy Gets or sets the CMY representation of the Color. cmy -> tuple The CMY representation of the Color. The CMY components are in the ranges C = [0, 1], M = [0, 1], Y = [0, 1]. Note that this will not return the absolutely exact CMY values for the set RGB values in all cases. Due to the RGB mapping from 0-255 and th...
pygame.ref.color#pygame.Color.cmy
correct_gamma() Applies a certain gamma value to the Color. correct_gamma (gamma) -> Color Applies a certain gamma value to the Color and returns a new Color with the adjusted RGBA values.
pygame.ref.color#pygame.Color.correct_gamma
g Gets or sets the green value of the Color. g -> int The green value of the Color.
pygame.ref.color#pygame.Color.g
hsla Gets or sets the HSLA representation of the Color. hsla -> tuple The HSLA representation of the Color. The HSLA components are in the ranges H = [0, 360], S = [0, 100], V = [0, 100], A = [0, 100]. Note that this will not return the absolutely exact HSL values for the set RGB values in all cases. Due to the RGB ...
pygame.ref.color#pygame.Color.hsla
hsva Gets or sets the HSVA representation of the Color. hsva -> tuple The HSVA representation of the Color. The HSVA components are in the ranges H = [0, 360], S = [0, 100], V = [0, 100], A = [0, 100]. Note that this will not return the absolutely exact HSV values for the set RGB values in all cases. Due to the RGB ...
pygame.ref.color#pygame.Color.hsva
i1i2i3 Gets or sets the I1I2I3 representation of the Color. i1i2i3 -> tuple The I1I2I3 representation of the Color. The I1I2I3 components are in the ranges I1 = [0, 1], I2 = [-0.5, 0.5], I3 = [-0.5, 0.5]. Note that this will not return the absolutely exact I1I2I3 values for the set RGB values in all cases. Due to th...
pygame.ref.color#pygame.Color.i1i2i3
lerp() returns a linear interpolation to the given Color. lerp(Color, float) -> Color Returns a Color which is a linear interpolation between self and the given Color in RGBA space. The second parameter determines how far between self and other the result is going to be. It must be a value between 0 and 1 where 0 me...
pygame.ref.color#pygame.Color.lerp
normalize() Returns the normalized RGBA values of the Color. normalize() -> tuple Returns the normalized RGBA values of the Color as floating point values.
pygame.ref.color#pygame.Color.normalize
premul_alpha() returns a Color where the r,g,b components have been multiplied by the alpha. premul_alpha() -> Color Returns a new Color where each of the red, green and blue colour channels have been multiplied by the alpha channel of the original color. The alpha channel remains unchanged. This is useful when work...
pygame.ref.color#pygame.Color.premul_alpha
r Gets or sets the red value of the Color. r -> int The red value of the Color.
pygame.ref.color#pygame.Color.r