ParaMonte MATLAB 3.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
DataFrame Class Reference

This is the abstract class for generating instances of objects that can contain basic attributes required for tabular read-only access to a MATLAB table-compatible data stored externally.
More...

Inheritance diagram for DataFrame:
Collaboration diagram for DataFrame:

Public Member Functions

function DataFrame (in dfref)
 Generate an return an object of class pm.data.DataFrame from the input dataframe or its specified input reference.
More...
 
function copy (in self)
 Generate and return a table copy of the dataframe contained in the user-specified input dfref to the constructor of the parent object.
More...
 
function ncol (in self)
 Generate and return the number of columns in the user-specified dataframe dfref at the time of constructing the parent object.
More...
 
function nrow (in self)
 Generate and return the number of rows in the user-specified dataframe dfref at the time of constructing the parent object.
More...
 
function rowslog (in self, in count, in start, in stop)
 Generate and return a natural logarithmically-spaced range of indices from the row indices of the input dataframe dfref to the parent object.
More...
 

Detailed Description

This is the abstract class for generating instances of objects that can contain basic attributes required for tabular read-only access to a MATLAB table-compatible data stored externally.

This class is merely a convenience read-only wrapper to reference external tabular data as table.
This class primarily exist to facilitate bypassing the lack of references and pointers in MATLAB.

Remarks
See the constructor documentation for example usage.
See also
DataRef


Final Remarks


If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.

Author:
Joshua Alexander Osborne, May 21 2024, 4:45 PM, University of Texas at Arlington
Fatemeh Bagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.
Amir Shahmoradi, May 16 2016, 9:03 AM, Oden Institute for Computational Engineering and Sciences (ICES), UT Austin

Definition at line 24 of file DataFrame.m.

Constructor & Destructor Documentation

◆ DataFrame()

function DataFrame::DataFrame ( in  dfref)

Generate an return an object of class pm.data.DataFrame from the input dataframe or its specified input reference.

This is the constructor of the class pm.data.DataFrame.

Parameters
[in]dfref: The input MATLAB 2D matrix or table containing the target dataset or function handle that takes no arguments and returns the dataset.
Specifying a function handle is superior to specifying the dataset directly, because the function handle will always allow the use of the most updated version of the user table or matrix.
(optional. default = table(zeros(0, 0)))
Returns
self : The output scalar object of class pm.data.DataFrame.


Possible calling interfaces

df = pm.data.DataFrame(dfref);


Example usage

1cd(fileparts(mfilename('fullpath'))); % Change working directory to source code directory.
2addpath('../../../'); % Add the ParaMonte library root directory to the search path.
3
4df = pm.data.DataFrame()
5df.copy()
6
7data = randi([0, 9], 10, 5)
8df = pm.data.DataFrame(data)
9df.copy()
10
11df = pm.data.DataFrame(table(data))
12df.copy()
13
14df.ncol()
15df.nrow()
16df.rowslog()
17df.rowslog(10)
18df.rowslog(10, 5, 100)
19df.rowslog(10, 5, 1000)
20df.rowslog([], 5, 1000)
21df.rowslog(10, -1, 1000)
22df.rowslog(10, -1, -2)
This is the abstract class for generating instances of objects that can contain basic attributes requ...
Definition: DataFrame.m:25
function copy(in self)
Generate and return a table copy of the dataframe contained in the user-specified input dfref to the ...
function nrow(in self)
Generate and return the number of rows in the user-specified dataframe dfref at the time of construct...
function rowslog(in self, in count, in start, in stop)
Generate and return a natural logarithmically-spaced range of indices from the row indices of the inp...
function ncol(in self)
Generate and return the number of columns in the user-specified dataframe dfref at the time of constr...
function root()
Return a scalar MATLAB string containing the root directory of the ParaMonte library package.

Example output
1df =
2 DataFrame with no properties.
3ans =
4 0x1 empty table
5data =
6 1 7 8 4 4
7 4 7 6 4 9
8 9 3 3 6 3
9 7 6 9 7 5
10 9 1 0 7 2
11 6 7 4 2 7
12 0 0 3 6 2
13 8 2 7 6 5
14 9 0 7 1 6
15 6 0 1 1 8
16df =
17 DataFrame with no properties.
18ans =
19 10x5 table
20 df1 df2 df3 df4 df5
21 ___ ___ ___ ___ ___
22 1 7 8 4 4
23 4 7 6 4 9
24 9 3 3 6 3
25 7 6 9 7 5
26 9 1 0 7 2
27 6 7 4 2 7
28 0 0 3 6 2
29 8 2 7 6 5
30 9 0 7 1 6
31 6 0 1 1 8
32df =
33 DataFrame with no properties.
34ans =
35 10x1 table
36 data
37 _____________________
38 1 7 8 4 4
39 4 7 6 4 9
40 9 3 3 6 3
41 7 6 9 7 5
42 9 1 0 7 2
43 6 7 4 2 7
44 0 0 3 6 2
45 8 2 7 6 5
46 9 0 7 1 6
47 6 0 1 1 8
48ans =
49 1
50ans =
51 10
52ans =
53 1 2 3 4 5 6 7 8 9 10
54ans =
55 1 2 3 4 5 6 8 10
56ans =
57 5 6 7 8 9 10
58ans =
59 5 6 7 8 9 10
60ans =
61 5 6 7 8 9 10
62ans =
63 1 2 3 4 5 6 8 10
64ans =
65 1x0 empty double row vector


Final Remarks


If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.

Author:
Joshua Alexander Osborne, May 21 2024, 4:54 PM, University of Texas at Arlington
Fatemeh Bagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.
Amir Shahmoradi, May 16 2016, 9:03 AM, Oden Institute for Computational Engineering and Sciences (ICES), UT Austin

Member Function Documentation

◆ copy()

function DataFrame::copy ( in  self)

Generate and return a table copy of the dataframe contained in the user-specified input dfref to the constructor of the parent object.

This class method offers the only way to access the user-specified dataframe.
The underlying logic behind the use of function to access the dataframe originates from the lack of the concept of references (pointers) in the MATLAB computing language.

Returns
df : The output scalar MATLAB table a full copy of the dataframe contained in the user-specified input dfref passed to the constructor of the parent object.


Possible calling interfaces

df = pm.data.DataFrame.copy()
Remarks
See the constructor documentation for example usage.


Final Remarks


If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.

Author:
Joshua Alexander Osborne, May 21 2024, 4:54 PM, University of Texas at Arlington
Fatemeh Bagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.
Amir Shahmoradi, May 16 2016, 9:03 AM, Oden Institute for Computational Engineering and Sciences (ICES), UT Austin

◆ ncol()

function DataFrame::ncol ( in  self)

Generate and return the number of columns in the user-specified dataframe dfref at the time of constructing the parent object.

This class method is a handy shorthand for size(self.dfref, 2), particularly useful for specifying a range of indices of columns in visualization tasks.

Returns
count : The output scalar MATLAB whole-number representing the number of columns in the dfref component of the parent object.


Possible calling interfaces

count = pm.data.DataFrame.ncol()
Remarks
See the constructor documentation for example usage.


Final Remarks


If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.

Author:
Joshua Alexander Osborne, May 21 2024, 5:00 PM, University of Texas at Arlington
Fatemeh Bagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.
Amir Shahmoradi, May 16 2016, 9:03 AM, Oden Institute for Computational Engineering and Sciences (ICES), UT Austin

◆ nrow()

function DataFrame::nrow ( in  self)

Generate and return the number of rows in the user-specified dataframe dfref at the time of constructing the parent object.

This class method is a handy shorthand for size(self.dfref, 2), particularly useful for specifying a range of indices of rows to visualize.

Parameters
[in]<tt>None</tt>
Returns
count : The output scalar MATLAB whole-number representing the number of rows in the dfref component of the parent object.


Possible calling interfaces

count = pm.data.DataFrame.nrow()
Remarks
See the constructor documentation for example usage.


Final Remarks


If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.

Author:
Joshua Alexander Osborne, May 21 2024, 5:04 PM, University of Texas at Arlington
Fatemeh Bagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.
Amir Shahmoradi, May 16 2016, 9:03 AM, Oden Institute for Computational Engineering and Sciences (ICES), UT Austin

◆ rowslog()

function DataFrame::rowslog ( in  self,
in  count,
in  start,
in  stop 
)

Generate and return a natural logarithmically-spaced range of indices from the row indices of the input dataframe dfref to the parent object.

This method is a convenience wrapper around function pm.array.logrange.

Warning
Beware of the different order of the input arguments between this method and pm.array.logrange.
Parameters
[in]count: The input scalar MATLAB whole-number (integer) representing the maximum size of the output range.
Due to rounding operation involved in creating the output range, it is impossible to prespecify the output range size, only the maximum.
(optional, default = 1000)
[in]start: The input scalar MATLAB whole-number (integer) representing the starting point of the output range.
It must be a number in the range [1, size(self.dfref, 1)]. Otherwise, the value max(1, min(start, self.nrow())) will be used.
(optional, default = 1)
[in]stop: The input scalar MATLAB whole-number (integer) representing the stopping point of the output range.
It must be a number in the range [1, size(self.dfref, 1)]. Otherwise, the value max(start, min(stop, self.nrow())) will be used.
(optional, default = 1)
Returns
indices : The output vector of MATLAB real values containing the set of naturally logarithmically-spaced integer values in the specified input range.


Possible calling interfaces

indices = pm.data.DataFrame()
indices = pm.data.DataFrame([])
indices = pm.data.DataFrame([], [])
indices = pm.data.DataFrame([], start)
indices = pm.data.DataFrame(count, [])
indices = pm.data.DataFrame(count, start)
indices = pm.data.DataFrame([], [], [])
indices = pm.data.DataFrame(count, [], [])
indices = pm.data.DataFrame([], start, [])
indices = pm.data.DataFrame([], [], stop)
indices = pm.data.DataFrame([], start, stop)
indices = pm.data.DataFrame(count, [], stop)
indices = pm.data.DataFrame(count, start, [])
indices = pm.data.DataFrame(count, start, stop)
Remarks
See the constructor documentation for example usage.


Final Remarks


If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.

Author:
Joshua Alexander Osborne, May 21 2024, 5:10 PM, University of Texas at Arlington
Fatemeh Bagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.
Amir Shahmoradi, May 16 2016, 9:03 AM, Oden Institute for Computational Engineering and Sciences (ICES), UT Austin

The documentation for this class was generated from the following file: