Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
FACT Unified Data IO
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FACT
FACT Utils
FACT Unified Data IO
Commits
40160d20
Commit
40160d20
authored
1 year ago
by
Riccardo Boero
Browse files
Options
Downloads
Patches
Plain Diff
Fixed Floating point reference in preprocessing of dataframes for SQL save
parent
470d24f7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/manifestIO.jl
+5
-6
5 additions, 6 deletions
src/manifestIO.jl
with
5 additions
and
6 deletions
src/manifestIO.jl
+
5
−
6
View file @
40160d20
...
...
@@ -366,17 +366,16 @@ After preprocessing, `df` will have its `NaN` and `Inf` values replaced with `no
function
preprocess_dataframe!
(
df
::
DataFrame
)
for
col
in
names
(
df
)
col_type
=
eltype
(
df
[
!
,
col
])
# Clamp values if range is defined for the column type
if
haskey
(
SQL_RANGES
,
col_type
)
min_val
,
max_val
=
SQL_RANGES
[
col_type
]
df
[
!
,
col
]
=
clamp
.
(
df
[
!
,
col
],
min_val
,
max_val
)
end
# Replace NaN and Inf with nothing
if
col_type
<:
FloatingPoin
t
# Replace NaN and Inf with nothing
for floating-point columns
if
col_type
<:
AbstractFloa
t
df
[
!
,
col
]
=
map
(
x
->
isfinite
(
x
)
?
x
:
nothing
,
df
[
!
,
col
])
end
end
end
end
\ No newline at end of file
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