Frame package¶
Basic Frame
Parameters¶
- valuesnp.ndarray
Data that is to be represented by the DataFrame. The dimensions of “values” must be equal to len(columns) x len(index)
- indexarray-like
Index that of values. len(index) must be equal to values.shape[1]
- Sloth.frame.Frame.astype()¶
Cast the values of the frame to the specified type.
- Parameters:
- type_type
Type to cast the values to.
Examples
>>> frame.astype(float)
- Sloth.frame.Frame.iterrows()¶
Iterate over the rows of the frame.
- Yields:
- np.ndarray
Numpy array representing a row of the frame.
Examples
>>> for row in frame.iterrows(): ... print(row) [1, 2, 3] [4, 5, 6]
- Sloth.frame.Frame.plot()¶
Plotting function. Requires matplotlib and Pandas to be installed. All parameters are passed onto pandas.
- Returns:
- matplotlib.axes.AxesSubplot
AxesSubplot object representing the plot.
- Sloth.frame.Frame.resample()¶
Resample the frame to a specified frequency.
- Parameters:
- freqstr
Frequency string.
- Returns:
- Resampler
Resampler object for resampling the frame.
Examples
>>> frame.resample('D')
- Sloth.frame.Frame.rolling()¶
Provide rolling window calculations.
- Parameters:
- windowint
Size of the moving window.
- Returns:
- Rolling
Rolling object for performing rolling window calculations.
Examples
>>> frame.rolling(3)
- Sloth.frame.Frame.to_numpy()¶
Convert the frame to a numpy array.
- Returns:
- np.ndarray
Numpy array representation of the frame.
Examples
>>> frame.to_numpy() array([[1, 2, 3], [4, 5, 6]])