Data cleaning: Difference between revisions

Jump to navigation Jump to search
55 bytes added ,  12 June 2015
Line 92: Line 92:
=== is null ===
=== is null ===
Fill 0 if the value is NA or NULL
Fill 0 if the value is NA or NULL
* MySQL SQL syntax: {{kbd | key = SELECT COALESCE(column_name, 0) }} Using [http://www.w3resource.com/mysql/comparision-functions-and-operators/coalesce-function.php COALESCE() function] to replace the NULL value with 0.  
* MySQL SQL syntax: {{kbd | key = SELECT COALESCE(column_name, 0) }}  
** (1) Using [http://www.w3resource.com/mysql/comparision-functions-and-operators/coalesce-function.php COALESCE() function] to replace the NULL value with 0.
** (2) The case: 0/0 = null should be handled.
* python: [http://pandas.pydata.org/pandas-docs/dev/generated/pandas.DataFrame.fillna.html pandas.DataFrame.fillna — pandas 0.16.0 documentation] "Fill NA/NaN values using the specified method"
* python: [http://pandas.pydata.org/pandas-docs/dev/generated/pandas.DataFrame.fillna.html pandas.DataFrame.fillna — pandas 0.16.0 documentation] "Fill NA/NaN values using the specified method"


Navigation menu