类 Series

  • 所有已实现的接口:
    Iterable

    public class Series
    extends Object
    implements Iterable
    作者:
    Yaqiang Wang
    • 构造器详细资料

      • Series

        public Series​(Array data,
                      Index index,
                      String name)
        Constructor
        参数:
        data - Data array
        index - Index
        name - Name
      • Series

        public Series​(Array data,
                      List idxValue,
                      String name)
        Constructor
        参数:
        data - Data array
        idxValue - Index value
        name - Name
      • Series

        public Series​(Array data,
                      String name)
        Constructor
        参数:
        data - Data array
        name - name
    • 方法详细资料

      • getData

        public Array getData()
        Get data array
        返回:
        Data array
      • setData

        public void setData​(Array value)
        Set data array
        参数:
        value - Data array
      • getIndex

        public Index getIndex()
        Get index
        返回:
        Index
      • setIndex

        public void setIndex​(Index value)
        Set index
        参数:
        value - Index
      • setIndex

        public void setIndex​(List value)
        Set index
        参数:
        value - Index value
      • getName

        public String getName()
        Get name
        返回:
        Name
      • setName

        public void setName​(String value)
        Set name
        参数:
        value - Name
      • isEmpty

        public boolean isEmpty()
        Get if the series contains no data
        返回:
        Boolean
      • getValue

        public Object getValue​(int i)
        Get a data value
        参数:
        i - Index
        返回:
        Data value
      • getValueByIndex

        public Object getValueByIndex​(Object idxValue)
        Get value by index
        参数:
        idxValue - Index value
        返回:
        Data value
      • setValue

        public void setValue​(int i,
                             Object v)
        Set a data value
        参数:
        i - Index
        v - Data value
      • setValue

        public void setValue​(Series s,
                             Object v)
        Set data values by another boolean series
        参数:
        s - Boolean series
        v - Data value
      • getValues

        public Series getValues​(List<Integer> ii)
        Get values
        参数:
        ii - index values
        返回:
        Result series
      • getValues

        public Series getValues​(Range range)
        Get values
        参数:
        range - Range
        返回:
        Result series
      • getValueByIndex

        public Series getValueByIndex​(List idxValues)
        Get values by index
        参数:
        idxValues - index values
        返回:
        Result series
      • getValueByIndex_bak

        public Series getValueByIndex_bak​(List idxValues)
        Get values by index
        参数:
        idxValues - index values
        返回:
        Result series
      • getIndexValue

        public Object getIndexValue​(int i)
        Get a index value
        参数:
        i - Index
        返回:
        Index value
      • size

        public int size()
        Get size
        返回:
        Size
      • groupBy

        public SeriesGroupBy groupBy​(KeyFunction function)
        Group the series rows using the specified key function.
        参数:
        function - the function to reduce rows to grouping keys
        返回:
        the grouping
      • groupBy

        public SeriesGroupBy groupBy()
        Group the series rows using the specified key function.
        返回:
        the grouping
      • groupBy

        public SeriesGroupBy groupBy​(TimeFunction function)
        Group the series rows using the specified time function.
        参数:
        function - the function to reduce rows to grouping keys
        返回:
        the grouping
      • groupBy

        public SeriesGroupBy groupBy​(String tStr)
        Group by time string - DateTimeIndex
        参数:
        tStr - Time string
        返回:
        The grouping
      • resample

        public SeriesGroupBy resample​(WindowFunction function)
        Group the series rows using the specified key function.
        参数:
        function - the function to reduce rows to grouping keys
        返回:
        the grouping
      • resample

        public SeriesGroupBy resample​(String pStr)
        Group the series rows using the specified key function.
        参数:
        pStr - Period string
        返回:
        the grouping
      • mean

        public Object mean()
        Compute the mean of the numeric columns for each group or the entire series if the data is not grouped.
        返回:
        Mean object
      • max

        public Object max()
        Compute the maximum of the numeric columns for each group or the entire series if the data is not grouped.
        返回:
        Maximum object
      • min

        public Object min()
        Compute the minimum of the numeric columns for each group or the entire series if the data is not grouped.
        返回:
        Minimum object
      • equal

        public Series equal​(Number v)
        Equal
        参数:
        v - Value
        返回:
        Result series
      • equal

        public Series equal​(String v)
        Equal
        参数:
        v - Value
        返回:
        Result series
      • lessThan

        public Series lessThan​(Number v)
        Less then
        参数:
        v - Value
        返回:
        Result series
      • lessThanOrEqual

        public Series lessThanOrEqual​(Number v)
        Less then or equal
        参数:
        v - Value
        返回:
        Result series
      • greaterThan

        public Series greaterThan​(Number v)
        Greater then
        参数:
        v - Value
        返回:
        Result series
      • greaterThanOrEqual

        public Series greaterThanOrEqual​(Number v)
        Greater then or equal
        参数:
        v - Value
        返回:
        Result series
      • head

        public String head​(int n)
        Convert to string - head
        参数:
        n - Head row number
        返回:
        The string
      • tail

        public String tail​(int n)
        Convert to string - tail
        参数:
        n - Tail row number
        返回:
        The string
      • saveCSV

        public void saveCSV​(String fileName,
                            String delimiter,
                            String dateFormat,
                            String floatFormat,
                            boolean index)
                     throws IOException
        Save as CSV file
        参数:
        fileName - File name
        delimiter - Delimiter
        dateFormat - Date format string
        floatFormat - Float format string
        index - If write index
        抛出:
        IOException