Basic Stats deprecated?

69 views
Skip to first unread message

mat...@gmail.com

unread,
Feb 25, 2022, 1:52:19 PM2/25/22
to sage-support
Mean, median and mode are now deprecated. E.g.:

>median([1,2,3])
2 :1: DeprecationWarning: sage.stats.basic_stats.median is deprecated; use numpy.median or numpy.nanmedian instead See https://trac.sagemath.org/29662 for details.

But shouldn't these basic functions have some default functionality? Is the intention really to make Sage users call basic functions from libraries. Students (mostly) don't know what numpy is and makes using mean, median and mode weirdly obscure - like calling combinatorics functions in Mathematica. For me (using Sage for classroom teaching) one attraction of Sage is that most basic things that a student would use have names that might be in their textbooks...

Will Calculus be deprecated too?

Matthias Koeppe

unread,
Feb 25, 2022, 3:50:39 PM2/25/22
to sage-support
If you consider numpy an obscure library, it may be that your syllabus needs updating

William Stein

unread,
Feb 25, 2022, 11:32:39 PM2/25/22
to sage-support
In fairness, "Mission: Creating a viable free open source alternative
to Magma, Maple, Mathematica and Matlab."

What do Maple and Mathematica do regarding having a median top level command?

Also, if you want to argue that users should explicitly import
everything... that's an interesting an valuable challenge to support
and your modularization
work Matthias is of course critical to that. However, it doesn't at
all preclude the default "sage" environment still being a viable
alternative to Maple and Mathematica.
> --
> You received this message because you are subscribed to the Google Groups "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-support...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/c7ec42b4-a966-47b6-a538-7bb943a50437n%40googlegroups.com.



--
William (http://wstein.org)

Kwankyu

unread,
Feb 26, 2022, 12:02:24 AM2/26/22
to sage-support
But shouldn't these basic functions have some default functionality?

+1 

Matthias Koeppe

unread,
Feb 26, 2022, 1:28:17 AM2/26/22
to sage-support
On Friday, February 25, 2022 at 8:32:39 PM UTC-8 wst...@gmail.com wrote:
Also, if you want to argue that users should explicitly import
everything...

No, that's not what I'm arguing. 

The deprecation of the basic_stats module happened because Sage has nothing to offer in this area;
it's a module with 5 functions that hasn't seen development since 2009. 
Underdeveloped modules like this reflect poorly on the rest of Sage.

It's a disservice to learners to offer these facilities of Sage as the standard vocabulary of doing basic stats on the computer.
They will be better off with virtually any other solution: With the built-in stats module of Python; with Numpy/SciPy; with Pandas; with R.




Henri Girard

unread,
Feb 26, 2022, 11:32:13 AM2/26/22
to William Stein, sage-support
Sorry : Effectively I thaught I send it to the sage-devel sage-support

Your welcome

Henri

Le 26/02/2022 à 16:57, William Stein a écrit :
> Thank you. However, did you mean to send this to sage-devel ? -- you
> just sent it to me personally.
>
>
> On Sat, Feb 26, 2022 at 12:19 AM Henri Girard <henri....@gmail.com> wrote:
>> Hi,
>>
>> I use sage from the begining, I learned mathematic with it,what I found
>> wonderfull is one doesn't need any libs (numpy, scipy...etc), 2 tweeks
>> ago I found wolfram engine and after some difficulties I can use it
>> inside jupyter (not yet sage), though I prefer sage because I can do lot
>> of things (even not mathematic, for example yin yang taiji I called it
>> math&physic against metaphysic, geometry plane I could use geogebra but
>> doing it Iearned many things radian,degree ), and I don't speak about
>> the help by email (though sometimes my stupid question, because I am not
>> a mathematician) sage is becoming like said one on web : the swiss knife !
>>
>> I call sage dao de qin I translate like sage path (voie sage), because
>> one can do everything with it !
>>
>> Using wolfram engine, I noticed when one knows sage it becomes easier.
>> But I my opinion mathematica is made for users not for thinkers, not for
>> true researchers because everything is offered on a palette ! lol
>>
>> I like sage because I can compile it, I tried all these years to buy a
>> better computer (every 5 years) to not spend days compiling. At the
>> moment my Rizen 16 cores with 16Go RAM, that's good.
>>
>> Sorry for this email written in french/english but I can tell you carry
>> on this wonderfull soft !
>>
>> Best regards
>>
>> Henri

Matthias Koeppe

unread,
Feb 26, 2022, 12:41:31 PM2/26/22
to sage-support
On Friday, February 25, 2022 at 10:52:19 AM UTC-8 mat...@gmail.com wrote:
Will Calculus be deprecated too?

See https://trac.sagemath.org/ticket/32260 for the next deprecation proposal.

John H Palmieri

unread,
Feb 28, 2022, 6:26:08 PM2/28/22
to sage-support
Should there be a small list of functions which we import automatically? For example in sage.all we could do: "from numpy import mean, median". It seems strange to not have a top-level "mean" or "median" function, given all of the other esoteric top-level functions.

Kwankyu

unread,
Feb 28, 2022, 8:04:01 PM2/28/22
to sage-support
Here is the ticket for this:

Matthias Koeppe

unread,
Feb 28, 2022, 8:15:58 PM2/28/22
to sage-support
The functionality has not been removed. We can do a slower deprecation here, i.e., not remove the module after a year, but perhaps after n years.
Reply all
Reply to author
Forward
0 new messages