Hi,
I am using "A[a,:]=row" in python, where A is a matrix and row is a
sequence. But it gives following error:
-------- error------
A[a,:]=row
ValueError: setting an array element with a sequence.
Is there a way to change type of sequence to array so that this
situation could be handled
thanks
Amit 2 2401 am***********@gmail.com wrote:
Hi,
I am using "A[a,:]=row" in python, where A is a matrix and row is a
sequence. But it gives following error:
-------- error------
A[a,:]=row
ValueError: setting an array element with a sequence.
Is there a way to change type of sequence to array so that this
situation could be handled
You don't say what array package you are using. I presume numpy. In any case,
the place to ask those questions (even for the older numarray and Numeric
packages) is the numpy list. http://www.scipy.org/Mailing_Lists
We will need some more information from you when you come to the numpy list.
Please reduce your problematic code to the smallest, self-contained script that
demonstrates the problem, and post it and the exact output that you get.
--
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
actually what i want to do is this:
i have a file with following format:
1 2
3 9
2 3
4 4
I want to read it and then store the values into two matrices, s.t.
A=[1 2;3 9]
B=[2 3;4 4]
any easier way of doing this?
thanks
Amit
Robert Kern wrote:
am***********@gmail.com wrote:
Hi,
I am using "A[a,:]=row" in python, where A is a matrix and row is a
sequence. But it gives following error:
-------- error------
A[a,:]=row
ValueError: setting an array element with a sequence.
Is there a way to change type of sequence to array so that this
situation could be handled
You don't say what array package you are using. I presume numpy. In any case,
the place to ask those questions (even for the older numarray and Numeric
packages) is the numpy list.
http://www.scipy.org/Mailing_Lists
We will need some more information from you when you come to the numpy list.
Please reduce your problematic code to the smallest, self-contained script that
demonstrates the problem, and post it and the exact output that you get.
--
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: vanGogh |
last post by:
I have generated classes based on an Xml schema file (xsd) using the XSD.exe tool.
My goal is to:
- write an application that can parse XML documents
- fill objects (based on the generated...
|
by: Jenny |
last post by:
Hi,
Can I create an array of tags by assigning same name to these tags?
For example, I have two <p> tags with the same name t1. But
document.all.b.value=document.all.t.length
does not...
|
by: Eric Bantock |
last post by:
Very basic question I'm afraid. Once an array has been declared, is there
a less tedious way of assigning values to its members than the following:
myarray=8;
myarray=3;
myarray=4;
myarray=0;...
|
by: Deniz Bahar |
last post by:
I know the basic definition of a sequence point (point where all side
effects guaranteed to be finished), but I am confused about this
statement:
"Between the previous and next sequence point an...
|
by: Doug Lerner |
last post by:
I have this snippet of client side code running:
var makeField = document.forms;
alert("makeFieldName name,length,type=" + makeFieldName + ", " +
makeField.name + "," + makeField.length + ","...
|
by: I.M. !Knuth |
last post by:
Hi. I'm more-or-less a C newbie. I thought I had pointers under control until
I started goofing around with this:
...
|
by: pat270881 |
last post by:
hello,
I have to implement a sequence class, however the header file is
predefined
class sequence
{
public:
// TYPEDEFS and MEMBER CONSTANTS
|
by: davydany |
last post by:
Hey guys...a n00b Here for this site.
I'm making a sequence class for my C++ class. And The thing is in the array that I have, lets say i put in {13,17,38,18}, when i see the current values for the...
|
by: miken32 |
last post by:
In PHP, if a function returns an array it's fairly common to capture
its return values like this:
<?php
list($foo, $bar, $baz) = some_function_that_return_an_array();
?>
In Javascript, would...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |