stargazer icon indicating copy to clipboard operation
stargazer copied to clipboard

New API for stargazer

Open toobaz opened this issue 5 years ago • 3 comments

I think it would be much more pythonic to do

table = Stargazer([model1, model2], show_adj_r2=False, show_notes=False)

or even

table = Stargazer([model1, model2]).config(show_adj_r2=False, show_notes=False)

(both approaches also allowing to pre-create a dict of arguments) than the current

table = Stargazer([model1, model2])
table.show_adj_r2 = False
table.show_notes = False

... and that this is going to be more and more important as stargazer supports more features/models.

The three approaches do not necessarily exclude each other, but I would like to present the first as standard. It also solves some inconsistencies such as show_model_numbers being a method while show_notes is an attribute.

toobaz avatar Jun 04 '20 10:06 toobaz

+1, I've so far created functions to specify tables in similar ways. The first also seems most natural to me.

MaxGhenis avatar Jun 04 '20 17:06 MaxGhenis

I know this is an ancient issue, but I wanted to throw in another suggestion, which is to make methods like Stargazer.covariate_order return self to enable chaining them together.

Keating950 avatar May 31 '23 15:05 Keating950

I know this is an ancient issue, but I wanted to throw in another suggestion, which is to make methods like Stargazer.covariate_order return self to enable chaining them together.

Thanks for your suggestion. I'm not 100% sure "methods like Stargazer.covariate_order" will even exist in the future, the alternative being something like config in my first post, but definitely it will be something that can be chained (again, as in the example).

And by the way, this is an old and inactive but definitely not obsolete issue.

toobaz avatar Jun 01 '23 04:06 toobaz