[sage-support] Re: keyboard shortcuts

2011-05-05 Thread clodemil
According to
http://www.sagemath.org/doc/reference/sagenb/notebook/config.html
I made another typo:
Comment/Uncomment Blocks: Highlight text and press ctrl-. to comment
it and ctrl-, to uncomment it. Alternatively, use ctrl-3 and ctrl-4.
But the problem remains: ctrl-. does not work with either keyboard.

Claude.

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: keyboard shortcuts

2011-05-04 Thread clodemil


Marshall,

Thank you for your answer.
Yes this happens in the notebook. And I mistyped "Ctrl+;" for "Ctrl+,"
sorry!
I thought at first the issue was with my diNovo Edge keyboard (without
numpad: figures accessed through shift key, so that "Ctrl+3" becomes
"Ctrl+Shift+3" and does not comment, neither does "Ctrl+,")
Substituting for a keyboard with numpad "Ctrl+," still does not work
but "Ctrl+3"does.
So the issue seems well to be with Sage.

Claude

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] keyboard shortcuts

2011-05-03 Thread clodemil
Commenting with select multiple lines >"Ctrl+," does not work
   Commenting line by line with "AltGr+#" works
   Uncommenting with select multiple lines >"Ctrl+;" does  work

Keyboard: Logitech diNovo Edge (no NumPad)
sage-4.6.1-linux-32bit-ubuntu_10.04_lts-i686-Linux/sage
Ubuntu 11.04 under VmWare under Vista Ultimate 64

The keyboard works normally in all other programs including Python
under Vista

TIAFYH

Claude

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support]

2011-04-24 Thread clodemil

Thank you

> Unfortunately, N is the name of the built-in numerical evaluation
> function:

N is used as such, not as a name

 Claude

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support]

2011-04-23 Thread clodemil
Many thanks

On Apr 23, 4:13 pm, "D. S. McNeil"  wrote:


> (3) Avoid "n" as a variable.

I promise to!!


> (4) Choose something else -- nn, or nap, or whatever -- and use it
> instead ("nn = numerical_approx", and then "nn(3.2445,digits=2)".

N does the job


> It's more Pythonic to write something like


 for x in mesuresF, :
     print x[-1],"  ",x[0],"  ",x[1:4]

does the job beautifully

> "Flat is better than nested",

Recorded as mantra

Thanks again.

Claude

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] results into list

2011-04-17 Thread clodemil
Hi all,

# Measurements are taken three times in one session and entered in a
continuous list "t":

t=[ 151, 129, 126, 158, 163, 165, 150, 120, 147, 148, 134, 114, 180,
167, 159, 196, 175, 162, 135, 145, 135, 176, 172, 184, 149, 150, 152,
185, 185, 168, 143, 151, 142, 178, 172, 164, 147, 146, 142, 172, 166,
170, 163, 151, 149, 144, 147, 135, 146, 136, 142];

# 3-tuples are isolated:

m=matrix(ZZ,17,3,t);print m.str();

# and put in a list of lists:

z=list(m);z;

# the mean of each session is calculated:

for i in z:
u=n(mean(i),digits=3);
u

# how can I get those into a list ?(so as to be able to zip it with a
time list and plot)

# Many thanks in advance.

# Claude.

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: commenting out

2011-04-02 Thread clodemil
Many thanks!

Claude.

On Apr 1, 12:50 pm, Håkan Granath  wrote:
> > In Python one can comment out a whole block of text with Alt+3, how
> > can I do that in Sage ?
>
> See this page:
>
> http://www.sagemath.org/doc/reference/sagenb/notebook/config.html
>
> /Håkan

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] commenting out

2011-04-01 Thread clodemil
Hi all,

In Python one can comment out a whole block of text with Alt+3, how
can I do that in Sage ?

TIA.

Claude

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: date call

2011-04-01 Thread clodemil
Thank you all, very useful.

Claude
On Mar 31, 4:08 pm, Dan Drake  wrote:
> On Thu, 31 Mar 2011 at 05:36AM -0700, clodemil wrote:
> > Is it possible to call up the calendar date and time, to be used in,
> > for instance, m=list(measurement,date) ?
>
> Python (and hence Sage) has a number of modules related to times and
> dates. Seehttp://docs.python.org/library/and search for "time" or
> "date".
>
> Dan
>
> --
> ---  Dan Drake
> -  http://mathsci.kaist.ac.kr/~drake
> ---
>
>  signature.asc
> < 1KViewDownload

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] date call

2011-03-31 Thread clodemil
Hi all,

Is it possible to call up the calendar date and time, to be used in,
for instance, m=list(measurement,date) ?

TIA

Claude.

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: list updating

2011-03-29 Thread clodemil
Jim,

Thank you, that was what I needed: now I can use one single list of 5-
tuples and update only once!

Claude.


On Mar 29, 2:46 pm, Jim Ragsdale  wrote:
> you might try using the zip command. If you use the * operator with zip it
> will unpack the elements into the individual variables
> Sys, Dia, Pulse =zip(*mesures)
> mesures.append([181,88,58])
> Sys[-1],Dia[-1],Pulse[-1]
>
> of course you can use zip to go the other way too:
> mesures = zip(Sys, Dia, Pulse)
>
> On Sat, Mar 26, 2011 at 5:32 AM, clodemil  wrote:
> > Hi All,
>
> > Measurements are taken for blood pressure and entered as 3-tuples:
> > [P_systolic,P_diastolic,Pulse_rate] and put in a list
>
> > mesures=[[172,91,57],[181,88,58],[146,88,56],[191,85,59],[171,92,50],
> > [157,93,55],[180,84,48],[142,77,60],[169,80,45],[162,76,59],
> > [167,104,73],[166,81,53],[145,78,59],[163,98,58],[192,90,50],
> > [184,85,60],[151,77,56]]
>
> > Various elements or the whole tuple are then used for diverse
> > calculations and yet again output in lists.
> > A new measurement entails updating ALL lists individually. So the idea
> > is to make it automatic using accessory variables x and y and extract
> > elements thereof.
>
> > mesures=[[172,91,57],[181,88,58],[146,88,56],[191,85,59],[171,92,50],
> > [157,93,55],[180,84,48],[142,77,60],[169,80,45],[162,76,59],
> > [167,104,73],[166,81,53],[145,78,59],[163,98,58],[192,90,50],
> > [184,85,60],[151,77,56]]
> > # [[P systolic,P diastolic,Pulse rate]]
> > temps=[1,18,24,28,49,87,101,108,113,116,122,133,156,161,166,170,180] #
> > Hours
> > Sys=[172,181,146,191,171,157,180,142,169,162,167,166,145,163,192,184,151]
> > Dia=[91,88,88,85,92,93,84,77,80,76,104,81,78,98,90,85,77]
> > Pulse=[57,58,56,59,50,55,48,60,45,59,73,53,59,58,50,60,77]
> > control=[len(temps),len(Sys),len(Dia),len(Pulse)] #all should be equal
>
> > x=[[185,82,57]] #new value to be appended to mesures
> > y=185 #new value to be appended to temps
>
> > mesures=mesures+x #appending new value
> > temps=temps + [y] #appending new value
> > Sys=Sys + [x[0][0]] #appending new value
> > Dia + [x[0][1]] #appending new value
> > Pulse + [x[0][2]] #appending new value
> > print control
> > print(mesures)
> > print temps
> > print Sys
>
> > JOY: It works
>
> > DISAPPOINTMENT: It works ONLY if I call the lists on their own and NOT
> > if they are called inside another cell:
> > they then appear in the original unappended form:
>
> > for i,j in enumerate(temps):
> >    for k,l in enumerate(mesures):
> >        for m,n in enumerate(heuresF):
> >            if m==k:
> >                if i==k:
> >                    print "Mesure n°",i,l,n
>
> > What am I doing wrong ?
>
> > TIA.
>
> > Claude
>
> > --
> > To post to this group, send email to sage-support@googlegroups.com
> > To unsubscribe from this group, send email to
> > sage-support+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/sage-support
> > URL:http://www.sagemath.org

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: function output to list

2011-03-26 Thread clodemil
Alastair,

Everything sorted. Many thanks.


Claude.

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: accented characters

2011-03-26 Thread clodemil
Mike,

But that can't be used in:

["Mar 15h30 apres 2 h d'effort"]



 Claude.

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: accented characters

2011-03-26 Thread clodemil
Mike,

Thanks for your response.

> How are you trying to use these characters?

My mother tongue is french !

Claude.

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] list updating

2011-03-26 Thread clodemil
Hi All,

Measurements are taken for blood pressure and entered as 3-tuples:
[P_systolic,P_diastolic,Pulse_rate] and put in a list

mesures=[[172,91,57],[181,88,58],[146,88,56],[191,85,59],[171,92,50],
[157,93,55],[180,84,48],[142,77,60],[169,80,45],[162,76,59],
[167,104,73],[166,81,53],[145,78,59],[163,98,58],[192,90,50],
[184,85,60],[151,77,56]]

Various elements or the whole tuple are then used for diverse
calculations and yet again output in lists.
A new measurement entails updating ALL lists individually. So the idea
is to make it automatic using accessory variables x and y and extract
elements thereof.

mesures=[[172,91,57],[181,88,58],[146,88,56],[191,85,59],[171,92,50],
[157,93,55],[180,84,48],[142,77,60],[169,80,45],[162,76,59],
[167,104,73],[166,81,53],[145,78,59],[163,98,58],[192,90,50],
[184,85,60],[151,77,56]]
# [[P systolic,P diastolic,Pulse rate]]
temps=[1,18,24,28,49,87,101,108,113,116,122,133,156,161,166,170,180] #
Hours
Sys=[172,181,146,191,171,157,180,142,169,162,167,166,145,163,192,184,151]
Dia=[91,88,88,85,92,93,84,77,80,76,104,81,78,98,90,85,77]
Pulse=[57,58,56,59,50,55,48,60,45,59,73,53,59,58,50,60,77]
control=[len(temps),len(Sys),len(Dia),len(Pulse)] #all should be equal

x=[[185,82,57]] #new value to be appended to mesures
y=185 #new value to be appended to temps

mesures=mesures+x #appending new value
temps=temps + [y] #appending new value
Sys=Sys + [x[0][0]] #appending new value
Dia + [x[0][1]] #appending new value
Pulse + [x[0][2]] #appending new value
print control
print(mesures)
print temps
print Sys

JOY: It works

DISAPPOINTMENT: It works ONLY if I call the lists on their own and NOT
if they are called inside another cell:
they then appear in the original unappended form:

for i,j in enumerate(temps):
for k,l in enumerate(mesures):
for m,n in enumerate(heuresF):
if m==k:
if i==k:
print "Mesure n°",i,l,n

What am I doing wrong ?

TIA.

Claude


-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] accented characters

2011-03-26 Thread clodemil
Hi All,

Sage does not accept accented characters like: é è à give a syntax
error.
If in a string it is accepted but coded like:" après" becomes 'apr
\xc3\xa8s'
I suppose it is a question of font encoding.
What can I do ?
Of course, my keyboard layout in Ubuntu 10.10 is properly set to
belgian french.

TIA

Claude

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: function output to list

2011-03-26 Thread clodemil
Alastair,

Thanks a lot.
the Pytonic way:

def Ppulse(mesures):
return [N((l[0]-l[1]),12) for l in mesures]

works(I shall need to understand/study why!!)
The other solution:

def Ppulse(mesures):
result=[]
for k,l in enumerate(mesures)
result.append(N((l[0]-l[1]),12))

gives a syntax error(most certainly my mistake, but what?)

>#Why are you using enumerate here, as you don't use k?
I use k in another step of the program.

Thanks again.

Claude.




On Mar 25, 8:24 am, Alastair Irving 
wrote:
> On 25/03/2011 13:15, clodemil wrote:> Hi all,
>
> > Here is a list:
>
> > mesures=[[172,91,57],[181,88,58],[146,88,56],[191,85,59],[171,92,50],
> > [157,93,55],[180,84,48],[142,77,60],[169,80,45],[162,76,59],
> > [167,104,73],[166,81,53],[145,78,59],[163,98,58],[192,90,50],
> > [184,85,60],[151,77,56]]
> > # [[P systolic,P diastolic,Pulse rate]]
>
> > and a function
>
> There's at least two ways of modifying this.  You could either append to
> a list as you go along:
>
> > def Ppulse(mesures):
>
>         results=[]
> #Why are you using enumerate here, as you don't use k?>      for k,l in 
> enumerate(mesures):
>
>             result.append(N((l[0]-l[1]),12))
>
> >          print N((l[0]-l[1]),12)
> > # Pulse Pressure = Psys - Pdia
>
> Or, a more Pythonic way of doing this would be with a list comprehension:
>
> def Pulse(measures): return [N((l[0]-l[1]),12) for l in measures]
>
> I hope this helps
>
> Alastair

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] function output to list

2011-03-25 Thread clodemil
Hi all,

Here is a list:

mesures=[[172,91,57],[181,88,58],[146,88,56],[191,85,59],[171,92,50],
[157,93,55],[180,84,48],[142,77,60],[169,80,45],[162,76,59],
[167,104,73],[166,81,53],[145,78,59],[163,98,58],[192,90,50],
[184,85,60],[151,77,56]]
# [[P systolic,P diastolic,Pulse rate]]

and a function

def Ppulse(mesures):
for k,l in enumerate(mesures):
print N((l[0]-l[1]),12)
# Pulse Pressure = Psys - Pdia

applying the function

Ppulse(mesures)

gives as result



81.0
93.0
58.0
106.
79.0
64.0
96.0
65.0
89.0
86.0
63.0
85.0
67.0
65.0
102.
99.0
74.0

how do I get those numbers into a list ?

TIAFYA

Claude.

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: background color in list_plot

2011-03-23 Thread clodemil
HI kcrisman ,

Thank you for your response.
The process looks  a bit frightening for someone as green as I am!
But after some deep breathing...

Claude.

On Mar 23, 1:16 pm, kcrisman  wrote:
> On Mar 23, 6:19 am, clodemil  wrote:
>
> > Hi Jason,
>
> > I know the question is very newbieish, but that is what I am:
>
> > Can the mentioned patch
> >  http://trac.sagemath.org/sage_trac/ticket/260
> > be tried and how: directly in Sage? ...in the terminal?...and then at
> > what prompt?...any danger that I break something?...
>
> Seehttp://www.sagemath.org/doc/developer/walk_through.html#reviewing-a-p...
> for some instructions.  You'll need to 
> usehttp://trac.sagemath.org/sage_trac/raw-attachment/ticket/260/trac_260...
> as the patch name.
>
> However, it is almost certain that this won't apply properly, since it
> is so old.   But you might as well try; we might get lucky!
>
> - kcrisman

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: background color in list_plot

2011-03-23 Thread clodemil
Hi Jason,

I know the question is very newbieish, but that is what I am:

Can the mentioned patch
 http://trac.sagemath.org/sage_trac/ticket/260
be tried and how: directly in Sage? ...in the terminal?...and then at
what prompt?...any danger that I break something?...

Thanks,

Claude.

On Mar 22, 4:21 pm, clodemil  wrote:
> Thank you for your quick answer.
>
> > What do you mean by
> > fillcolor?
>
> I mean the option existing in plot, like:
> plot(tan(x),-1,1,fill=True,fillcolor='red')
>
> Thanks,
>
> Claude.
> On Mar 22, 2:52 pm, Jason Grout  wrote:
>
> > On 3/22/11 5:27 AM, clodemil wrote:
>
> > > Hello,
>
> > > Is there a way to add a background color and/or a fillcolor to a
> > > list_plot ?
>
> > There is a ticket [1] and a patch to add background_color as an option
> > to plot, but the code has not been merged yet.  What do you mean by
> > fillcolor?
>
> > Thanks,
>
> > Jason
>
> > [1]http://trac.sagemath.org/sage_trac/ticket/260

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: background color in list_plot

2011-03-22 Thread clodemil
Thank you for your quick answer.

> What do you mean by
> fillcolor?

I mean the option existing in plot, like:
plot(tan(x),-1,1,fill=True,fillcolor='red')

Thanks,

Claude.
On Mar 22, 2:52 pm, Jason Grout  wrote:
> On 3/22/11 5:27 AM, clodemil wrote:
>
> > Hello,
>
> > Is there a way to add a background color and/or a fillcolor to a
> > list_plot ?
>
> There is a ticket [1] and a patch to add background_color as an option
> to plot, but the code has not been merged yet.  What do you mean by
> fillcolor?
>
> Thanks,
>
> Jason
>
> [1]http://trac.sagemath.org/sage_trac/ticket/260

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] background color in list_plot

2011-03-22 Thread clodemil
Hello,

Is there a way to add a background color and/or a fillcolor to a
list_plot ?

TIAFYKA

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org