Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-advanced-user-tools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-advanced-user-tools
Commits
5f94c93b
Commit
5f94c93b
authored
11 months ago
by
Florian Spreckelsen
Browse files
Options
Downloads
Patches
Plain Diff
DOC: Add some documentation for the TableImporter
parent
2f9d7ed2
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!107
Release v0.11.0
,
!106
F gaps in int columns
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/doc/index.rst
+1
-0
1 addition, 0 deletions
src/doc/index.rst
src/doc/utilities.rst
+37
-0
37 additions, 0 deletions
src/doc/utilities.rst
with
38 additions
and
0 deletions
src/doc/index.rst
+
1
−
0
View file @
5f94c93b
...
...
@@ -18,6 +18,7 @@ This documentation helps you to :doc:`get started<README_SETUP>`, explains the m
Specifying a datamodel with JSON schema <json_schema_interface>
Convert a data model into a json schema <json_schema_exporter>
Conversion between XLSX, JSON and LinkAhead Entities <table-json-conversion/specs>
Other utilities <utilities>
_apidoc/modules
Related Projects <related_projects/index>
Back to overview <https://docs.indiscale.com/>
...
...
This diff is collapsed.
Click to expand it.
src/doc/utilities.rst
0 → 100644
+
37
−
0
View file @
5f94c93b
Other utilities in LinkAhead Advanced User Tools
================================================
The table file importer
%%%%%%%%%%%%%%%%%%%%%%%
The LinkAhead Advanced user tools provide a generic
:py:class:`~caosadvancedtools.table_importer.TableImporter` class which reads
different table file formats (at the time of writing of this documentation,
.xls(x), .csv, and .tsv) and converts them into :py:class:`pandas.DataFrame`
objects. It provides helper functions for converting column values (e.g.,
converting the string values "yes" or "no" to ``True`` or ``False``), checking
the presence of obligatory columns in a table and whether those have missing
values, and datatype checks.
The base class :py:class:`~caosadvancedtools.table_importer.TableImporter`
provides the general verification methods, while each subclass like
:py:class:`~caosadvancedtools.table_importer.XLSXImporter` or
:py:class:`~caosadvancedtools.table_importer.CSVImporter` implements its own
``read_file`` function that is used to convert a given table file into a
:py:class:`pandas.DataFrame`.
Empty fields in integer columns
--------------------------------
Reading in table files that have integer-valued columns with missing data can
result in datatype contradictions (see the Pandas documentation on `nullable
integers <https://pandas.pydata.org/docs/user_guide/integer_na.html>`_) since
the default value for missing fields, ``numpy.nan``, is a float. This is why
from version 0.11 and above, the ``TableImporter`` uses
:py:class:`pandas.Int64Dtype` as the default datatype for all integer columns
which allows for empty fields while keeping all actual data integer-valued. This
behavior can be changed by initializing the ``TableImporter`` with
``convert_int_to_nullable_int=False`` in which case a
:py:class:`~caosadvancedtools.datainconsistency.DataInconsistencyError` is
raised when an empty field is encountered in a column with an non-nullable
integer datatype.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment