16

Given that multiple languages support broadcasting with very similar meaning to how Numpy uses the word, it'd perhaps be nice to rename to a more general . This seems like a much better situation than adding, e.g., and and ...

Further, nearly all questions currently tagged are also tagged , so nothing of value will be lost. I'd be happy to manually go through and add to those ~65 questions currently missing the tag if appropriate.

10
  • 5
    I agree. A few weeks ago I wanted to tag a MATLAB question with broadcasting, only to realize the same thing. It didn't seem off enough to me to consider a retag, but now that you mention it this is very much straightforward. Oct 1, 2019 at 18:04
  • 2
    Also, all of the [numpy-broadcasting] questions should be tagged with [numpy] whether or not the tag gets renamed. But of course the usual caveats apply: we should not flood the front page with old posts, crap should be closed rather than edited, and good posts should be given more than just a retag to fix any possible issues with them while we're at it. Oct 1, 2019 at 18:36
  • 1
    So this is my first question on Meta — what are the next steps? Should we be slowly cleaning up those questions missing the numpy tag? I'd also be curious about the rationale of the downvoter; if there's an argument against doing this I'd love to hear it.
    – mbauman
    Oct 4, 2019 at 17:59
  • 2
    Well, it's only been 4 days but there haven't been any objections (beyond an unexplained downvote, but there are users who object to tag-related issues altogether). Numpy users should not be affected by the change, since [numpy]+[array-broadcasting] should be as good as [numpy]+[numpy-broadcasting]. And non-numpy users should only benefit from having the more general tag. I'll ping a few matlab people just to be sure we're not missing anything, but otherwise I have enough score in the tag to suggest a new synonym, which we can create to cover other languages as well. Oct 5, 2019 at 11:43
  • 1
    @AndrasDeak Why not make that into an answer? I agree, by the way. Even though MATLAB refers to it as “implicit singleton expansion” rather than broadcasting. Oct 6, 2019 at 12:59
  • 1
    So with no objections I think we should slowly fix the numpy-less numpy-broadcasting questions, and then suggest the synonym. I've seen plenty of mistags and other issues after a cursory glance at the ~60 questions. Oct 8, 2019 at 20:24
  • 1
    I've already found questions that are not numpy, but broadcasting (case in point: pandas). I think most of these should just be retagged with vectorization unless explicitly asking about broadcasting behaviour. Oct 8, 2019 at 20:49
  • Nice, then the search to triage is [numpy-broadcasting] -[numpy] -[pandas]: stackoverflow.com/questions/tagged/…
    – mbauman
    Oct 8, 2019 at 21:12
  • @MattB. I disagree, we should be looking at pandas posts too. A lot of these non-numpy tagged questions are really about vectorization, which I guess makes sense because broadcasting is a more specific problem. I've added some typical scenarios to my answer, do let me know if you bump into other cases not yet accounted for. Oct 8, 2019 at 21:17
  • a) In principal this sounds ok, but in practice users might tag not just Matlab, octave, Julia but also C++ and other languages/packages. So as long as people are prepared to police usage of this tag... b) as AndrasDeak says, the tag wiki really would need to succinctly distinguish between what is broadcasting vs what is merely vectorization.
    – smci
    May 11, 2020 at 19:05

1 Answer 1

12

Follow-up: I have tagged the questions without the tag, created the new tag with a simple and broad excerpt, and asked the mods to synonymize the former into the latter, which they have. As of now we only have .

Appropriate edits for the tag wiki are welcome! I'm only familiar with broadcasting in MATLAB/Octave and Python's NumPy, which work more or less the same (dimensions of size 1, including implicit trailing or leading dimensions, can be expanded to larger size to match arrays in certain operations). I have heard that broadcasting in R includes arbitrary repetition of arrays, e.g. broadcasting length 3 to length 5. I suspect Julia is somewhere on this axis.

It would also be nice to explain in a few words the difference between vectorization and broadcasting, as the two often get confused. I don't feel like I have a notion well-defined enough to write the wiki myself, that's why I've only added a short excerpt.

Original answer continues below for posterity.


I agree. A few weeks ago I wanted to tag a MATLAB question with broadcasting, only to realize the same thing. It didn't seem off enough to me to consider a retag, but now that you mention it this is very much straightforward.

Firstly, all of the [numpy-broadcasting] questions should be tagged with [numpy] whether or not the tag gets renamed. But of course the usual caveats apply: we should not flood the front page with old posts, crap should be closed rather than edited, and good posts should be given more than just a retag to fix any possible issues with them while we're at it.

Secondly, numpy users should not be affected by the proposed change, since [numpy]+[array-broadcasting] should be as good as [numpy]+[numpy-broadcasting]. And non-numpy users should only benefit from having the more general tag. Unless some objections are raised soon I have enough score in the tag to suggest a new synonym, which we can create to cover the other languages as well.


With no apparent objections I think we can slowly start fixing the few questions not tagged with but tagged with . Some possible scenarios:

  1. the question is not answerable or should not be kept around for another reason: don't edit, vote to close and later vote to delete. Example.
  2. the question is not really about numpy broadcasting, maybe not even numpy, just vectorization: change to . Example.
  3. the question is about numpy and numpy broadcasting: add . Example.

And of course if anything else is missing (for instance a generic tag) we should add that too while we're at it. Linking back to this retag request in the edit summary might help explain why some of these questions are suddenly getting edited.

6
  • 1
    Any chance any action will be taken here? May 11, 2020 at 13:01
  • @StefanKarpinski I think we can go forward. The procedure is 1. go over these, close the bad ones, retag the non-broadcasting ones, tag the good numpy ones with [numpy], 2. synonymize [numpy-broadcasting] to [array-broadcasting] (we can do this in the python room). Just at a slow pace so as not to flood the main page with old questions. May 11, 2020 at 17:56
  • @StefanKarpinski OK, I've gone over the linked questions and handled them. I'll suggest the synonym for the tag and rewrite the excerpt to make it more general. May 11, 2020 at 18:50
  • +100 Let us know if there's anything @MattB or I can do to help. May 12, 2020 at 19:00
  • @StefanKarpinski I'll get a mod to do the synonymizing, until then you can just start using the [array-broadcasting] tag. You could edit the tag wiki and excerpt of the new tag for something general and reasonable. For the time being I just copied over a slightly modified excerpt from the [numpy-broadcasting] tag. I'm only familiar with broadcasting in MATLAB and numpy, which might be different from Julia. R for instance is more general according to this. May 12, 2020 at 19:11
  • 1
    @StefanKarpinski it is done, see e.g. numpy-broadcasting. I've updated my answer: you (or others) should try writing something in the tag wiki, if possible. May 13, 2020 at 18:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .