What is wrong with this

N

nure123

Hi,

I am new to Python and would be grateful if anyone could tell me what
is wrong with the following statement.

Y=array([1/S, 0*lam])

where
S=[1, 2, 3, 4]
lam=[5, 6, 7, 8]

I am using Numeric not the NumPy and the original module in which this
statement appears is supposed to be working perfectly fine since an
executable based on that module is working fine ( I may be wrong if
the original author derived his executable file from a version of
module other than the one whose code is distributed)

Thanks,

Nure
 
S

Steven D'Aprano

Hi,

I am new to Python and would be grateful if anyone could tell me what is
wrong with the following statement.

Y=array([1/S, 0*lam])

where
S=[1, 2, 3, 4]
lam=[5, 6, 7, 8]


Oh, a guessing game! I love guessing games.

Let's see now... did you actually want to do a Fourier transform of some
data?

If not, perhaps you could tell us what you expected to happen, and what
actually happened, so we can stop guessing and actually help.
 
N

nure123

I am new to Python and would be grateful if anyone could tell me what is
wrong with the following statement.
Y=array([1/S, 0*lam])
where
S=[1, 2, 3, 4]
lam=[5, 6, 7, 8]

Oh, a guessing game! I love guessing games.

Let's see now... did you actually want to do a Fourier transform of some
data?

If not, perhaps you could tell us what you expected to happen, and what
actually happened, so we can stop guessing and actually help.


I get an error like 'inconsistent shape in sequence.' I changed it to
Y=array([1/S, zeros(len(lam))])

it works fine. But I am still interested in knowing why did the
original programmer did not get any error whereas I got an error with
the statement : Y=array([1/S, 0*lam])
 
S

Steven D'Aprano

But I am still interested in knowing why did the original
programmer did not get any error whereas I got an error with the
statement : Y=array([1/S, 0*lam])


*shrug*

How do you know it worked fine for the original programmer? Maybe he
released software with a bug. It happens.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top