src/tropycal/tracks/storm.py
def to_dataframe(self, attrs_as_columns=False):
        
        r"""
        Converts the storm dict into a pandas DataFrame object.
        
        Parameters
        ----------
        attrs_as_columns : bool
            If True, adds Storm object attributes as columns in the DataFrame returned. Default is False.
        
        Returns
        -------
        pandas.DataFrame
            A pandas DataFrame object containing information about the storm.
        """
        
        #Try importing pandas
        try:
            import pandas as pd
        except ImportError as e:
            raise RuntimeError("Error: pandas is not available. Install pandas in order to use this function.") from e
            
        #Set up empty dict for dataframe
        time = self.dict['date']
        ds = {}
        
        #Add every key containing a list into the dict
        keys = [k for k in self.dict.keys()]
        for key in keys:
            if isinstance(self.dict[key], list):
                ds[key] = self.dict[key]
            else:
                if attrs_as_columns:
                    ds[key] = self.dict[key]

        #Convert entire dict to a DataFrame
        ds = pd.DataFrame(ds)

        #Return dataset
        return ds
r"""
        Converts the storm dict into a pandas DataFrame object.
        
        Parameters
        ----------
        attrs_as_columns : bool
            If True, adds Storm object attributes as columns in the DataFrame returned. Default is False.
        
        Returns
        -------
        pandas.DataFrame
            A pandas DataFrame object containing information about the storm.
        
r"""
Converts the storm dict into a pandas DataFrame object.

Parameters

attrs_as_columns : bool
If True, adds Storm object attributes as columns in the DataFrame returned. Default is False.

Returns

pandas.DataFrame
A pandas DataFrame object containing information about the storm.
r " " " Converts the storm dict into a pandas DataFrame object . Parameters attrs_as_columns : bool If True adds Storm object attributes as columns in the DataFrame returned . Default is False . Returns pandas . DataFrame A pandas DataFrame object containing information about the storm .
def to_dataframe(self, attrs_as_columns=False):
        try:
            import pandas as pd
        except ImportError as e:
            raise RuntimeError("Error: pandas is not available. Install pandas in order to use this function.") from e
        time = self.dict['date']
        ds = {}
        keys = [k for k in self.dict.keys()]
        for key in keys:
            if isinstance(self.dict[key], list):
                ds[key] = self.dict[key]
            else:
                if attrs_as_columns:
                    ds[key] = self.dict[key]
        ds = pd.DataFrame(ds)
        return ds
def to_dataframe ( self , attrs_as_columns = False ) : try : import pandas as pd except ImportError as e : raise RuntimeError ( "Error: pandas is not available. Install pandas in order to use this function." ) from e time = self . dict [ 'date' ] ds = { } keys = [ k for k in self . dict . keys ( ) ] for key in keys : if isinstance ( self . dict [ key ] , list ) : ds [ key ] = self . dict [ key ] else : if attrs_as_columns : ds [ key ] = self . dict [ key ] ds = pd . DataFrame ( ds ) return ds
r"""
Converts the storm dict into a pandas DataFrame object.
r " " " Converts the storm dict into a pandas DataFrame object .
r"""
        Converts the storm dict into a pandas DataFrame object.
        
        Parameters
        ----------
        attrs_as_columns : bool
            If True, adds Storm object attributes as columns in the DataFrame returned. Default is False.
        
        Returns
        -------
        pandas.DataFrame
            A pandas DataFrame object containing information about the storm.
        """ #Try importing pandas #Set up empty dict for dataframe #Add every key containing a list into the dict #Convert entire dict to a DataFrame #Return dataset
self
attrs_as_columns