0

What does "[, ]" mean in Python args? They can be seen in input arguments such as:

cv2.Canny(image, threshold1, threshold2[, edges[, apertureSize[, L2gradient]]])

or scikit-learn; (e.g sklearn.linear_model.LinearRegression):

fit(X, y[, sample_weight])  Fit linear model.

What does y[, sample_weight] actually mean? Does it mean something like the first dimension in the array?

y[:,sample_weight]

Update: Thanks for the answers, it means optional. But why are they nested though?

threshold2[, edges[, apertureSize[, L2gradient]]]
Stark
  • 2,581
  • 2
  • 17
  • 20

0 Answers0