Bug 498982 - When importing a CSV file, columns can get erroneously converted to int if they start with a long string of zeroes, leading to data loss.
Summary: When importing a CSV file, columns can get erroneously converted to int if th...
Status: RESOLVED DUPLICATE of bug 498595
Alias: None
Product: LabPlot2
Classification: Applications
Component: frontend (show other bugs)
Version: latest
Platform: Flatpak Linux
: NOR minor
Target Milestone: ---
Assignee: Alexander Semke
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-01-21 22:48 UTC by realkpavel
Modified: 2025-01-22 07:37 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description realkpavel 2025-01-21 22:48:44 UTC
SUMMARY

When importing a CSV file, columns can get erroneously converted to int if they start with a long string of whole number entries, leading to data loss.

STEPS TO REPRODUCE
1. create a CSV file. One of the columns has "0" in it for the first 2000 lines, followed by 2000 lines containing "0.3".
2. import the CSV into LabPlot2

OBSERVED RESULT
The column that starts with a long list of "0" is imported as an "Integer", which rounds all its entries to a whole number. Since the rest of the column contains values smaller than 1, all entries are lost.

EXPECTED RESULT
Option 1: The software detects the non-zero entries and selects a Double datatype.
Option 2: The user can override the automatic assignment of "Integer" in the custom filter options.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Fedora 41, using LabPlot2 from Flathub

ADDITIONAL INFORMATION
There is workaround for this issue: using a text editor, change the "0" in the first data row to "0.0".
Comment 1 Alexander Semke 2025-01-22 07:36:34 UTC
*** This bug has been marked as a duplicate of bug 498595 ***
Comment 2 Alexander Semke 2025-01-22 07:37:36 UTC
(In reply to realkpavel from comment #0)
> SUMMARY
> 
> When importing a CSV file, columns can get erroneously converted to int if
> they start with a long string of whole number entries, leading to data loss.
> 
> STEPS TO REPRODUCE
> 1. create a CSV file. One of the columns has "0" in it for the first 2000
> lines, followed by 2000 lines containing "0.3".
> 2. import the CSV into LabPlot2
> 
> OBSERVED RESULT
> The column that starts with a long list of "0" is imported as an "Integer",
> which rounds all its entries to a whole number. Since the rest of the column
> contains values smaller than 1, all entries are lost.
> 
> EXPECTED RESULT
> Option 1: The software detects the non-zero entries and selects a Double
> datatype.
> Option 2: The user can override the automatic assignment of "Integer" in the
> custom filter options.

We addressed this recently, please check the last comment in bug 498595.