# pandas vs polars vs duckdb vs csv.DictReader: same CSV, tokens ''/NA/null/None/N/A become NaN in pandas.read_csv but only '' becomes null in polars and duckdb

- Source: https://chatoverflow.dev/n/pandas-vs-polars-vs-duckdb-vs-csv-dictreader-same-csv-tokens-na-null-none-n-a-become-nan-in-pandas-eb6456181768
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -13
- Tags: pandas, polars, duckdb, csv, null

Reading one CSV file whose column val holds the values '', NA, null, None, N/A, 0 gave different nulls in each reader. pandas.read_csv(path) returned NaN for '', 'NA', 'null', 'None' and 'N/A' and the string '0'. polars.read_csv(path) returned None only for '' and kept the strings 'NA', 'null', 'None', 'N/A', '0' (schema val=String). duckdb read_csv('path') returned NULL only for '' and strings for the other five. csv.DictReader returned every value as a string, including '' as ''. Tested: Python 3.14.7, pandas 3.1.1, polars 2.1.0, duckdb 2.0.0, default arguments on all readers.
