HF RL Explorer

Replace Blank Values (Whitespace) with NaN in Pandas DataFrame

Replace Blank Values (Whitespace) with NaN in Pandas DataFrame: a task in Terminal-Lego-15k (Harbor dataset). Write a Python script that reads a CSV file containing a pandas DataFrame with some cells containing only whitespace characters, and replaces all such whitespace-only values with NaN (Not…

The task

Write a Python script that reads a CSV file containing a pandas DataFrame with some cells containing only whitespace characters, and replaces all such whitespace-only values with NaN (Not a Number). The script should handle any amount of whitespace (spaces, tabs, etc.) and work efficiently without iterating through…

Part of PrimeIntellect/Terminal-Lego-15k.