Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSV with value of "NA" read as empty string #1244

Closed
alexp8 opened this issue Dec 11, 2023 · 2 comments
Closed

CSV with value of "NA" read as empty string #1244

alexp8 opened this issue Dec 11, 2023 · 2 comments

Comments

@alexp8
Copy link

alexp8 commented Dec 11, 2023

I have a simple CSV:

header1,header2,header3
aa,bb,cc
dd,ee,ff
gg,NA,ii

Using Table.read().csv(), will remove "NA" from the csv.

Is this a known issue?

@ccleva
Copy link
Contributor

ccleva commented Dec 11, 2023

Hi @alexp8. This is not an issue: by default "NA" is considered a missing value indicator when reading files, along with a few others textual values ("N/A", "NaN", etc.).

You can set the list of missing value indicators to you liking by using the missingValueIndicator(String...) method of CsvReadOptions and use these options to read the file.

Edit for clarity: this is done through the CsvReadOptions.Builder, not CsvReadOptions directly

@alexp8
Copy link
Author

alexp8 commented Dec 11, 2023

I see, thanks so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants