from numpy import *
a = zeros((2,40), int)
fields = {}
field = 10
fields[field] = '30A', 5
iy = int(fields[field][1])
ix = int(fields[field][0].rstrip('AB'))
for i in range(2):
for j in range(iy):
# put(a,[39  j],[1]) #1d
Can someone help me figure out how I would do it for multiple rows?
I thought,
put(a,[i][39j],[1])
but,
Traceback (most recent call last):
put(a,[i][39  j],[1])
IndexError: list index out of range 2 4018
On Nov 13, 1:22 pm, "Bryan.Fodn...@gmail.com"
<Bryan.Fodn...@gmail.comwrote:
from numpy import *
a = zeros((2,40), int)
fields = {}
field = 10
fields[field] = '30A', 5
iy = int(fields[field][1])
ix = int(fields[field][0].rstrip('AB'))
for i in range(2):
for j in range(iy):
# put(a,[39  j],[1]) #1d
Can someone help me figure out how I would do it for multiple rows?
I thought,
put(a,[i][39j],[1])
but,
Traceback (most recent call last):
put(a,[i][39  j],[1])
IndexError: list index out of range
Try
put(a, [(i, 39j)], [1]
Note, however, that in this case you could just as easily use
a[i, 39j] = 1
instead.
Nathan Davis Br***********@gmail.com wrote:
from numpy import *
a = zeros((2,40), int)
fields = {}
field = 10
fields[field] = '30A', 5
iy = int(fields[field][1])
ix = int(fields[field][0].rstrip('AB'))
for i in range(2):
for j in range(iy):
# put(a,[39  j],[1]) #1d
Can someone help me figure out how I would do it for multiple rows?
numpy questions are best asked on the numpy mailing list. http://www.scipy.org/Mailing_Lists
I thought,
put(a,[i][39j],[1])
but,
Traceback (most recent call last):
put(a,[i][39  j],[1])
IndexError: list index out of range
In this case, you don't really want put(). Just use indexing:
for i in range(2):
for j in range(iy):
a[i,39j] = 1

Robert Kern
"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
 Umberto Eco This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: mclaugb 
last post by:
Has anyone recompiled the Scientific Computing package using NumPy instead
of Numeric?
I need a least squares algorithm and a Newton Rhaphson algorithm which is
contained in Numeric but all the...

by: drife 
last post by:
Hello,
I use the Python Numeric package extensively, and had been an
avid user of the "old" scipy. In my view, both pieces of software
are truly first rate, and have greatly improved my...

by: nikie 
last post by:
I'm a little bit stuck with NumPy here, and neither the docs nor
trial&error seems to lead me anywhere:
I've got a set of data points (x/ycoordinates) and want to fit a
straight line through...

by: Gary Wessle 
last post by:
Hi
I am trying to install NumPy in my debian/testing linux
2.6.151686.
with no numpy for debian/testing, I am left alone, since the
experimental version available by debian will result in a...

by: Bryan 
last post by:
hi,
what is the difference among numeric, numpy and numarray? i'm going to start
using matplotlib soon and i'm not sure which one i should use.
this page says, "Numarray is a...

by: greg.landrum 
last post by:
After using numeric for almost ten years, I decided to attempt to
switch a large codebase (python and C++) to using numpy. Here's are
some comments about how that went.
 The code to...

by: robert 
last post by:
just a note  some speed comparisons :
0.60627370238398726
0.42836673376223189
0.36965815487747022
0.016557970357098384
0.15692469294117473
0.01951756438393204

by: Juergen Kareta 
last post by:
Hello,
this is my first try to get wxmpl1.2.8 running. Therefor I installed:
python 2.5
matplotlib0.87.6.win32py2.5.exe
numpy1.0rc3.win32py2.5.exe
on WinXP SP2

by: Duncan Smith 
last post by:
Hello,
Since moving to numpy I've had a few problems with my existing
code. It basically revolves around the numpy scalar types. e.g.

array(,...

by: Marc Oldenhof 
last post by:
Hello all,
I'm pretty new to Python, but use it a lot lately. I'm getting a crazy
error trying to do operations on a string list after importing numpy.
Minimal example:
Python 2.5.1...

by: isladogs 
last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, Mike...

by: VivesProcSPL 
last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many Englishlike terms and syntax in an effort to make it easy to learn, particularly for...

by: isladogs 
last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
For other local times, please check World Time Buddy
In...

by: jianzs 
last post by:
Introduction
Cloudnative applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...

by: abbasky 
last post by:
### Vandf component communication method one: data sharing
Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...

by: jimatqsi 
last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...

by: isladogs 
last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM).
In this month's session, the creator of the excellent VBE...

by: egorbl4 
last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это
Что это? Что мне с этим делать?
...

by: MeoLessi9 
last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
 