Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-14932

Allow DataFrame.replace() to replace values with None

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.3.0
    • Component/s: SQL
    • Labels:

      Description

      Current doc: http://spark.apache.org/docs/1.6.1/api/python/pyspark.sql.html#pyspark.sql.DataFrame.replace

      I would like to specify None as the value to substitute in. This is currently disallowed. My use case is for replacing bad values with None so I can then ignore them with dropna().

      For example, I have a dataset that incorrectly includes empty strings where there should be None values. I would like to replace the empty strings with None and then drop all null data with dropna().

        Attachments

          Activity

            People

            • Assignee:
              bravozhang Bravo Zhang
              Reporter:
              nchammas Nicholas Chammas
            • Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: