man-group / dtale

Visualizer for pandas data structures
http://alphatechadmin.pythonanywhere.com
GNU Lesser General Public License v2.1
4.62k stars 390 forks source link

Dynamically Calculating Column Aggregates #857

Closed eunosm3 closed 2 months ago

eunosm3 commented 2 months ago

This is more of a feature request, or a "How do I..." question... I use D-Tale to display and filter portfolio holdings. As a result, I'm often interested in aggregate values for the line items being displayed. For instance, total market value or weighted-means of yields, etc. Obviously, I can calculate those figures prior to displaying them in Jupyter with D-Tale. Over time, I've realized how useful it would the aggregate values could be recalculated in real time while interacting with the dataframe.

I understand that I can manually calculate the values (maybe not the weighted mean) using D-Tales' built-in functionality through the Summarize Data menu. However, besides not being automagic, the calculated values would not react to changes made to the source data table.

Are dynamically-calculated column totals possible to do with D-Tale? Or is such a thing out of scope for it?

Alternatively, is it possible to link a widget to D-Tale somehow so that the widget displays those values in a nearby cell?

Any help would be appreciated.

aschonfeld commented 2 months ago

@eunosm3 how's this?

https://github.com/man-group/dtale/assets/11547371/9179b597-07ec-4ab2-90e0-d408280d0317

aschonfeld commented 2 months ago

@eunosm3 just added this feature in v3.12.0 on pypi. Let me know if you have any issues