# Read NULL as missing in dataframe

**URL:** <https://discourse.julialang.org/t/read-null-as-missing-in-dataframe/63823>\
**Category:** General Usage\
**Tags:** dataframes, csv\
**Created:** [June 30, 2021, 12:07pm UTC](https://discourse.julialang.org/t/read-null-as-missing-in-dataframe/63823 "2021-06-30T12:07:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ismam](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ismam/32/26140_2.png) [@Ismam](https://discourse.julialang.org/u/Ismam)\
**Post date:** [June 30, 2021, 12:07pm UTC](https://discourse.julialang.org/t/read-null-as-missing-in-dataframe/63823/1 "2021-06-30T12:07:00Z")

</div>

Hi,

I’m reading a csv file (originally obtained from SQL) that has the string “NULL” to signify no value. This is not an empty string (although I am curious how that gets tackled too).

How do I read this string as a missing type in Julia?

> df = DataFrame( CSV.File( “file1.csv” ) )

I was hoping there would be a argument in CSV.File or DataFrames I could use to declare missing values. Coming from an R background, in the data.table R package you could do something like:

> df = fread( “file.csv”, na.strings = “NULL”)

Any tips?

---

<div class="post-metadata">

**Author:** ![sijo](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@sijo](https://discourse.julialang.org/u/sijo)\
**Post date:** [June 30, 2021, 12:14pm UTC](https://discourse.julialang.org/t/read-null-as-missing-in-dataframe/63823/2 "2021-06-30T12:14:28Z")

</div>

You’re looking for [Home · CSV.jl](https://csv.juliadata.org/stable/#Missing-Strings)

By default, you get a missing value if and only if the field is empty in the CSV file.

To get `missing` both for empty fields and `NULL`, you can use `CSV.File(..., missingstrings=["NULL", ""])`.
