Skip to content
Advertisement

Is there a way to mimic the pipe operator from R in Python?

See the example below. Is it possible to put each Python operation on a new line? If I have many operations, the code is not all visible. I need to scroll the VS Code window to the right. Thanks

JavaScript

Advertisement

Answer

In Python, line breaks inside parentheses are ignored, so you could rewrite as:

JavaScript

This post may be helpful.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement