data_manipulation

Contents

return_list_smart [#1]

Check the source code online
1
def return_list_smart(lst):
Copied!
  docstring:
1
If the list has length > returns the list
2
3
if it has length == 1 it returns the element
4
5
if it has length == 0 it returns None
Copied!

return_dict_smart [#15]

Check the source code online
1
def return_dict_smart(dct):
Copied!
  docstring:
no docstring

get_coords [#25]

Check the source code online
1
def get_coords(obj, mirror=False, mirror_ax='x'):
Copied!
  docstring:
1
Takes coordinates in various format and turns them into what's
2
expected from VTK plotter for rendering.
3
4
Can take a dict, Pandas Dataframe or Series
5
6
:param obj: dict, pandas.DataFrame or pandas.Series
7
8
:param mirror: if True, the coordinates are mirrored around mirror_ax
9
(Default value = False)
10
11
:param mirror_ax: ax to be used for mirroring ['x', 'y', 'z'] (Default
12
value = 'x')
Copied!

flatten_list [#66]

Check the source code online
1
def flatten_list(lst):
Copied!
  docstring:
1
Flattens a list of lists
2
3
:param lst: list
Copied!

is_any_item_in_list [#82]

Check the source code online
1
def is_any_item_in_list(L1, L2):
Copied!
  docstring:
1
Checks if an item in a list is in another list
2
3
:param L1:
4
5
:param L2:
Copied!

get_slice_coord [#98]

Check the source code online
1
def get_slice_coord(bounds, n):
Copied!
  docstring:
1
Given the bounds of an actor, return the point that
2
3
corresponds to the n% of the bounds range
4
5
:param bounds: should be a list of two floats
6
7
:param n: n should be a float in range 0, 1
Copied!
Last modified 1yr ago