Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. COThis just fills the entire array with NaNs. Look at my middle example where the lines are "In[262]" and "Out[262]". I want the output of that operation to be directly assignable back as a column in bdata, such that the indices of that small output (two date values) are broadcasted back to the places where they came from in bdata (this info has to be in the groupby object, it's just not clear how to use it without resorting to looping over the groups themselves, which is specifically what I want to avoid doing).
      singulars
    2. COWith `summedbdata` I meant your 'ln 262'. Then you reindex this result according to the original DataFrame, matching their indices on the 2 values in your example. The fill method I provided determines how to fill the rest of the columns (which are NaN by default).
      singulars
    3. COI think you're confused. There's only one column involved. For some indices (those which have the same date as date #1) the column will get one constant value. For other indices (those that have date equal to date #2) they'll get the other constant values. There aren't other "columns" to fill. I tested this method and it does not work as you are saying. It doesn't re-index something indexed by date and turn it into something indexed by identifier, which is what my example requires. The date indices derive from places where identifiers have that date, so groupby should know how to inverse-map.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload