pyufunc.dict_delete_keys#

pyufunc.dict_delete_keys(dictionary, keys)#

Delete keys from dictionary.

Parameters:
  • dictionary (dict) – the input dictionary with key-value pairs

  • keys (list | str | tuple) – the keys to be deleted

Returns:

the dictionary after deleting keys

Return type:

dict

Examples

>>> import pyufunc as uf
>>> d = {'a': 1, 'b': 2, 'c': 3, 'd': 4}
>>> keys = ['a', 'b']
>>> res = uf.delete_dict_keys(d, keys)
>>> res
{'c': 3, 'd': 4}