ntjohnson1 commented on code in PR #1411:
URL:
https://github.com/apache/datafusion-python/pull/1411#discussion_r2905101034
##########
python/datafusion/functions.py:
##########
@@ -510,27 +522,74 @@ def ascii(arg: Expr) -> Expr:
def asin(arg: Expr) -> Expr:
- """Returns the arc sine or inverse sine of a number."""
+ """Returns the arc sine or inverse sine of a number.
+
+ Examples:
+ ---------
+ >>> ctx = dfn.SessionContext()
+ >>> df = ctx.from_pydict({"a": [0.0]})
+ >>> result = df.select(dfn.functions.asin(dfn.col("a")).alias("asin"))
+ >>> result.collect_column("asin")[0].as_py()
+ 0.0
+ """
return Expr(f.asin(arg.expr))
def asinh(arg: Expr) -> Expr:
- """Returns inverse hyperbolic sine."""
+ """Returns inverse hyperbolic sine.
+
+ Examples:
+ ---------
+ >>> ctx = dfn.SessionContext()
+ >>> df = ctx.from_pydict({"a": [0.0]})
+ >>> result = df.select(dfn.functions.asinh(dfn.col("a")).alias("asinh"))
+ >>> result.collect_column("asinh")[0].as_py()
+ 0.0
+ """
return Expr(f.asinh(arg.expr))
def atan(arg: Expr) -> Expr:
- """Returns inverse tangent of a number."""
+ """Returns inverse tangent of a number.
+
+ Examples:
+ ---------
+ >>> ctx = dfn.SessionContext()
+ >>> df = ctx.from_pydict({"a": [0.0]})
+ >>> result = df.select(dfn.functions.atan(dfn.col("a")).alias("atan"))
+ >>> result.collect_column("atan")[0].as_py()
+ 0.0
+ """
return Expr(f.atan(arg.expr))
def atanh(arg: Expr) -> Expr:
- """Returns inverse hyperbolic tangent."""
+ """Returns inverse hyperbolic tangent.
+
+ Examples:
+ ---------
+ >>> ctx = dfn.SessionContext()
+ >>> df = ctx.from_pydict({"a": [0.0]})
+ >>> result = df.select(dfn.functions.atanh(dfn.col("a")).alias("atanh"))
+ >>> result.collect_column("atanh")[0].as_py()
+ 0.0
+ """
return Expr(f.atanh(arg.expr))
def atan2(y: Expr, x: Expr) -> Expr:
- """Returns inverse tangent of a division given in the argument."""
+ """Returns inverse tangent of a division given in the argument.
+
+ Examples:
+ ---------
+ >>> ctx = dfn.SessionContext()
+ >>> df = ctx.from_pydict({"y": [0.0], "x": [1.0]})
+ >>> result = df.select(
+ ... dfn.functions.atan2(dfn.col("y"), dfn.col("x")).alias("atan2"))
+ >>> result = result
Review Comment:
Will remove duplicate
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]