forked from SciSharp/NumSharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNDArray.std.cs
More file actions
40 lines (38 loc) · 2.68 KB
/
NDArray.std.cs
File metadata and controls
40 lines (38 loc) · 2.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using System.Diagnostics.CodeAnalysis;
using NumSharp.Backends;
namespace NumSharp
{
[SuppressMessage("ReSharper", "ParameterHidesMember")]
public partial class NDArray
{
/// <summary>
/// Compute the standard deviation along the specified axis.
/// Returns the standard deviation, a measure of the spread of a distribution, of the array elements. The standard deviation is computed for the flattened array by default, otherwise over the specified axis.
/// </summary>
/// <param name="keepdims">
/// If this is set to True, the axes which are reduced are left in the result as dimensions with size one. With this option, the result will broadcast correctly against the input array.
/// </param>
/// <param name="ddof">Means Delta Degrees of Freedom. The divisor used in calculations is N - ddof, where N represents the number of elements. By default ddof is zero.</param>
/// <returns> returns a new array containing the std values, otherwise a reference to the output array is returned.</returns>
/// <remarks>https://docs.scipy.org/doc/numpy/reference/generated/numpy.std.html</remarks>
public NDArray std(bool keepdims = false, int? ddof = null, NPTypeCode? dtype = null)
{
return np.std(this, keepdims, ddof, dtype);
}
/// <summary>
/// Compute the standard deviation along the specified axis.
/// Returns the standard deviation, a measure of the spread of a distribution, of the array elements. The standard deviation is computed for the flattened array by default, otherwise over the specified axis.
/// </summary>
/// <param name="axis">Axis or axes along which the standard deviation is computed. The default is to compute the standard deviation of the flattened array.</param>
/// <param name="keepdims">
/// If this is set to True, the axes which are reduced are left in the result as dimensions with size one. With this option, the result will broadcast correctly against the input array.
/// </param>
/// <param name="ddof">Means Delta Degrees of Freedom. The divisor used in calculations is N - ddof, where N represents the number of elements. By default ddof is zero.</param>
/// <returns> returns a new array containing the std values, otherwise a reference to the output array is returned.</returns>
/// <remarks>https://docs.scipy.org/doc/numpy/reference/generated/numpy.std.html</remarks>
public NDArray std(int axis, bool keepdims = false, int? ddof = null, NPTypeCode? dtype = null)
{
return np.std(this, axis, keepdims, ddof, dtype);
}
}
}