2.2. czekitout.convert

Contains functions that facilitate type-conversions with useful error messages when exceptions are thrown.

Functions

to_bool

Convert input object to a bool.

to_bool_numpy_array_3d

Convert input object to a boolean 3D numpy array.

to_bool_numpy_matrix

Convert input object to a boolean 2D numpy array.

to_complex_numpy_array

Convert input object to a complex-valued numpy array.

to_complex_numpy_matrix

Convert input object to a complex-valued numpy array.

to_dict

Convert input object to an instance of the class dict.

to_float

Convert input object to a float.

to_int

Convert input object to an int.

to_list_of_bools

Convert input object to a list of booleans.

to_list_of_floats

Convert input object to a list of floating-point numbers.

to_list_of_ints

Convert input object to a list of int objects.

to_list_of_nonnegative_floats

Convert input object to a list of nonnegative floating-point numbers.

to_list_of_nonnegative_ints

Convert input object to a list of nonnegative integers.

to_list_of_positive_floats

Convert input object to a list of positive floating-point numbers.

to_list_of_positive_ints

Convert input object to a list of positive integers.

to_list_of_strs

Convert input object to a list of strings.

to_multi_dim_slice

Convert a multi-dimensional slice-like input object to a multi-dimensional slice object.

to_nonnegative_float

Convert input object to a nonnegative float.

to_nonnegative_int

Convert input object to a nonnegative int.

to_nonnegative_numpy_array

Convert input object to a nonnegative numpy array.

to_nonnegative_numpy_matrix

Convert input object to a nonnegative numpy matrix.

to_numpy_array

Convert input object to a numpy array.

to_pair_of_floats

Convert input object to a two-element tuple of float objects.

to_pair_of_ints

Convert input object to a two-element tuple of int objects.

to_pair_of_nonnegative_floats

Convert input object to a two-element tuple of nonnegative float objects.

to_pair_of_nonnegative_ints

Convert input object to a two-element tuple of non-negative int objects.

to_pair_of_positive_floats

Convert input object to a two-element tuple of positive float objects.

to_pair_of_positive_ints

Convert input object to a two-element tuple of positive int objects.

to_pairs_of_floats

Convert input object to a tuple of two-element tuples of float objects.

to_pairs_of_ints

Convert input object to a tuple of two-element tuples of int objects.

to_pairs_of_nonnegative_ints

Convert input object to a tuple of two-element tuples of nonnegative integers.

to_positive_float

Convert input object to a positive float.

to_positive_int

Convert input object to a positive int.

to_quadruplet_of_nonnegative_ints

Convert input object to a four-element tuple of non-negative int objects.

to_quadruplet_of_positive_floats

Convert input object to a four-element tuple of positive float objects.

to_real_numpy_array

Convert input object to a real-valued numpy array.

to_real_numpy_array_1d

Convert input object to a real-valued 1D numpy array.

to_real_numpy_array_3d

Convert input object to a real-valued 3D numpy array.

to_real_numpy_matrix

Convert input object to a real-valued numpy array.

to_real_two_column_numpy_matrix

Convert input object to a real-valued 2D two-column numpy array.

to_single_dim_slice

Convert a one-dimensional slice-like input object to a one-dimensional slice object.

to_str_from_str_like

Convert string-like input object to an instance of the class str.

to_tuple_of_bools

Convert input object to a tuple of booleans.

to_tuple_of_floats

Convert input object to a tuple of floating-point numbers.

to_tuple_of_ints

Convert input object to a tuple of int objects.

to_tuple_of_nonnegative_floats

Convert input object to a tuple of nonnegative floating-point numbers.

to_tuple_of_nonnegative_ints

Convert input object to a tuple of nonnegative integers.

to_tuple_of_positive_floats

Convert input object to a tuple of positive floating-point numbers.

to_tuple_of_positive_ints

Convert input object to a tuple of positive integers.

to_tuple_of_strs

Convert input object to a tuple of strings.