---
title: "Discussion on \"Data Wrangling with Python Datatable - Conditional Statements\" | Hashnode"
description: "Discussion on \"Data Wrangling with Python Datatable - Conditional Statements\". Transformation based on a Single Condition\nSource data\nTask: if c is positive, then value should be a - b, else b - a.\nfrom datatable import dt, f, update, ifelse\n\ndf = dt.Frame({\"a\": [1, 1, 2, 4], \n               \"b\": [2, 2, 3, 2], \n               \"..."
url: "https://hashnode.com/posts/data-wrangling-with-python-datatable-conditional-statements/60055fec7b30c23b714aaea0"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Data Wrangling with Python Datatable - Conditional Statements](https://datawrangler.hashnode.dev/data-wrangling-with-python-datatable-conditional-statements?utm_source=hashnode&utm_medium=feed)

Transformation based on a Single Condition Source data Task: if c is positive, then value should be a - b, else b - a. from datatable import dt, f, update, ifelse df = dt.Frame({"a": \[1, 1, 2, 4\], "b": \[2, 2, 3, 2\], "...

Jan 18, 2021 · 4 min read · datawrangler.hashnode.dev  
Read the article

-   [#python](https://hashnode.com/tag/python)
-   [#data-science](https://hashnode.com/tag/data-science)
-   [#data](https://hashnode.com/tag/data)

## Written by

[Samuel Oranyeli](https://hashnode.com/@Samukweku)

@Samukweku · Australia

  
[View profile](https://hashnode.com/@Samukweku)

Data wrangler

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
