Main data frame type for storing heterogeneous tabular data
A data frame consists of columns of potentially different types, similar to a spreadsheet or database table. Each column must have the same number of rows.
new([char_len])
- Initialize data framedestroy()
- Free memoryncols()
- Get number of columnsnrows()
- Get number of rowsget_max_char_len()
- Get maximum character lengthheader(index)
- Get column header by indexdtype(index or header)
- Get column data typeis_initialized()
- Check if data frame is initializedType | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
type(column), | private, | dimension(:), allocatable | :: | data_cols | |||
character(len=:), | private, | dimension(:), allocatable | :: | headers | |||
logical, | private | :: | initialized | = | .false. | ||
integer, | private | :: | max_char_len | = | MAX_CHAR_LEN_DEFAULT | ||
integer, | private | :: | num_cols | = | 0 | ||
logical, | private | :: | with_headers | = | .false. |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(data_frame), | intent(in) | :: | this | |||
character(len=*), | intent(in) | :: | header |
Destroy a data frame and free all memory
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(data_frame), | intent(inout) | :: | this |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(data_frame), | intent(in) | :: | this | |||
character(len=*), | intent(in) | :: | header |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(data_frame), | intent(in) | :: | this | |||
integer, | intent(in) | :: | index |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(data_frame), | intent(in) | :: | this | |||
character(len=*), | intent(in) | :: | header |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(data_frame), | intent(in) | :: | this | |||
integer, | intent(in) | :: | index |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(data_frame), | intent(in) | :: | this | |||
character(len=*), | intent(in) | :: | header |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(data_frame), | intent(in) | :: | this | |||
integer, | intent(in) | :: | index |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(data_frame), | intent(in) | :: | this |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(data_frame), | intent(in) | :: | this |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(data_frame), | intent(in) | :: | this | |||
integer, | intent(in) | :: | index |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(data_frame), | intent(inout) | :: | this |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(data_frame), | intent(in) | :: | this |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(data_frame), | intent(in) | :: | this |
Initialize a new data frame
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(data_frame), | intent(inout) | :: | this | |||
integer, | intent(in), | optional | :: | char_len |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(data_frame), | intent(in) | :: | this |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(data_frame), | intent(inout) | :: | this |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(data_frame), | intent(inout) | :: | this | |||
integer, | intent(in) | :: | index | |||
type(column), | intent(in) | :: | col |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(data_frame), | intent(inout) | :: | this | |||
integer, | intent(in) | :: | index | |||
character(len=*), | intent(in) | :: | header |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(data_frame), | intent(inout) | :: | this | |||
logical, | intent(in) | :: | has_headers |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(data_frame), | intent(inout) | :: | this | |||
character(len=*), | intent(in), | optional | :: | header | ||
integer, | intent(in) | :: | col_size |
type :: data_frame private integer :: num_cols = 0, max_char_len = MAX_CHAR_LEN_DEFAULT logical :: with_headers = .false. character(len=:), dimension(:), allocatable :: headers type(column), dimension(:), allocatable :: data_cols logical :: initialized = .false. contains private ! Constructor/Destructor procedure, public :: new => df_constructor procedure, public :: destroy => df_destructor procedure, public :: is_initialized => df_is_initialized ! Basic info procedure, public :: ncols => df_get_num_cols procedure, public :: nrows => df_get_num_rows procedure, public :: get_max_char_len => df_get_max_char_len procedure, public :: header => get_header procedure :: df_get_col_type_header, df_get_col_type_index generic, public :: dtype => df_get_col_type_header, df_get_col_type_index ! Internal utility procedures (public for use by other datafort modules) procedure, public :: already_header procedure, public :: resize_storage procedure, public :: validate_column_addition procedure, public :: find_header_index procedure, public :: get_data_col ! Access to internal column object procedure, public :: set_data_col ! Set internal column object procedure, public :: get_with_headers ! Check if has headers procedure, public :: set_with_headers ! Set headers flag procedure, public :: set_header_at_index ! Set header at specific index procedure, public :: increment_num_cols ! Increment column count end type data_frame