traffic/core/flight.py
def diff(self, features: Union[str, List[str]], **kwargs) -> "Flight":
        """Assign differential versions of features to new columns.

        >>> flight.diff("track")

        The two following commands are equivalent:

        >>> flight.diff(["track", "heading"])
        >>> flight.diff(track="track_diff", heading="heading_diff")

        """
        assign_dict = dict()
        if isinstance(features, str):
            features = [features]
        if isinstance(features, Iterable):
            for feature in features:
                assign_dict[feature + "_diff"] = self.data[feature].diff()
        for key, value in kwargs.items():
            assign_dict[value] = self.data[key].diff()
        return self.assign(**assign_dict)
Assign differential versions of features to new columns.

        >>> flight.diff("track")

        The two following commands are equivalent:

        >>> flight.diff(["track", "heading"])
        >>> flight.diff(track="track_diff", heading="heading_diff")

        
Assign differential versions of features to new columns.

The two following commands are equivalent.


Assign differential versions of features to new columns . The two following commands are equivalent .
def diff(self, features: Union[str, List[str]], **kwargs) -> "Flight":
        assign_dict = dict()
        if isinstance(features, str):
            features = [features]
        if isinstance(features, Iterable):
            for feature in features:
                assign_dict[feature + "_diff"] = self.data[feature].diff()
        for key, value in kwargs.items():
            assign_dict[value] = self.data[key].diff()
        return self.assign(**assign_dict)
def diff ( self , features : Union [ str , List [ str ] ] , ** kwargs ) -> "Flight" : assign_dict = dict ( ) if isinstance ( features , str ) : features = [ features ] if isinstance ( features , Iterable ) : for feature in features : assign_dict [ feature + "_diff" ] = self . data [ feature ] . diff ( ) for key , value in kwargs . items ( ) : assign_dict [ value ] = self . data [ key ] . diff ( ) return self . assign ( ** assign_dict )
Assign differential versions of features to new columns.
Assign differential versions of features to new columns .
"""Assign differential versions of features to new columns.

        >>> flight.diff("track")

        The two following commands are equivalent:

        >>> flight.diff(["track", "heading"])
        >>> flight.diff(track="track_diff", heading="heading_diff")

        """
self
features
Union[str, List[str]]