def __setitem__(self, key, item):
        """
        Set an element or elements of the array.

        This function extends ``ndarray.__setitem__``.

        If the second value of the provided `key` is a string corresponding
        to a valid channel name, this function converts it to a number and
        passes it to ndarray's `__setitem__`. This allows for indexing by
        channel name when writing to a FCSData object.

        """
        # If key is a tuple with no Nones, decompose and interpret key[1] as 
        # the channel. If it contains Nones, pass directly to 
        # ndarray.__setitem__().
        if isinstance(key, tuple) and len(key) == 2 \
            and key[0] is not None and key[1] is not None:
            # Separate key components
            key_event = key[0]
            key_channel = key[1]

            # Convert key_channel to integers if necessary
            if not isinstance(key_channel, slice):
                key_channel = self._name_to_index(key_channel)

            # Reassemble key components
            key_all = (key_event, key_channel)

            # Write into array
            np.ndarray.__setitem__(self, key_all, item)

        else:
            # Get sliced array using native getitem function.
            np.ndarray.__setitem__(self, key, item)
def __setitem__ ( self , key , item ) : if isinstance ( key , tuple ) and len ( key ) == 2 and key [ 0 ] is not None and key [ 1 ] is not None : key_event = key [ 0 ] key_channel = key [ 1 ] if not isinstance ( key_channel , slice ) : key_channel = self . _name_to_index ( key_channel ) key_all = ( key_event , key_channel ) np . ndarray . __setitem__ ( self , key_all , item ) else : np . ndarray . __setitem__ ( self , key , item )
Set an element or elements of the array.

        This function extends ``ndarray.__setitem__``.

        If the second value of the provided `key` is a string corresponding
        to a valid channel name, this function converts it to a number and
        passes it to ndarray's `__setitem__`. This allows for indexing by
        channel name when writing to a FCSData object.