473,498 Members | 1,532 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Concatenating numerical and string attributes

Hey,
I have these attributes:

index[i]
which is a numerical value value

vector[i]
which is a numerical float value

and I want to concatenate like this:

featurevector = string(1)+ " " + string(index[i]) +
":" +string(vector[i])
However, when I run my program I get this error:

$Traceback (most recent call last):
File "try.py", line 70, in ?
featurevector=string(index[i])+string(vector[i])
TypeError: 'module' object is not callable
What I have to do is this:

I have to write this feature vector which occurs in
computation of some loop to a file. The file has to be
in append more since I have to separate various
feature vectors by space.

For example the I have to write like this:

1 10:0.2304 20:0.2804 30:0.567

I have these values 10:0.2304, 20:0.2804, 30:0.567
coming from a loop where I compute index them as
index, value pair. i.e. the tuple is index[i],
vector[i].
I was trying to do this by concatenating 1 and then
subsequent strings. However, I have this error.
Can some one point me how to do this, though seems to
be simple, but I am ignorant. Note that I need to
write 1 only once, in the starting.
Thanks A Ton to this list,
Dont

__________________________________
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com

Jul 18 '05 #1
1 2034
On Fri, 12 Mar 2004 01:26:14 -0800 (PST),
dont bother <do*************@yahoo.com> wrote:
featurevector = string(1)+ " " + string(index[i]) +
":" +string(vector[i])
However, when I run my program I get this error: $Traceback (most recent call last):
File "try.py", line 70, in ?
featurevector=string(index[i])+string(vector[i])
TypeError: 'module' object is not callable


"string" is a module.

"str" is a type.

HTH,
Heather

--
Heather Coppersmith
That's not right; that's not even wrong. -- Wolfgang Pauli
Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
8664
by: Brian Kazian | last post by:
Here's my problem, and hopefully someone can help me figure out if there is a good way to do this. I am writing a program that allows the user to enter an equation in a text field using...
16
3034
by: Dixie | last post by:
I have a problem using Dev Ashish's excellent module to concatenate the results of a field from several records into one record. I am using the code to concatenate certain awards onto a...
12
5773
by: Pol Bawin | last post by:
Hi All, Did somebody already define attributes for numerical properties to define value : minima, maxima, a number of decimal, ...? This information would be useful to unify syntax Polo
1
1518
by: Pol Bawin | last post by:
Hi All, Did somebody already define attributes for numerical properties to define values : minima, maxima, a number of décimals, ...? This information would be useful to unify syntax Polo
4
2314
by: Juan | last post by:
Does any one know if there are reported bugs when concatenating strings? When debugging each variable has the correct value but when I try to concatenate them some values are missing (I can´t see...
4
1643
by: lindiwemaduna | last post by:
I want to concatenate values of two text boxes into one string but these should be separated by a space in the database table. i have tried all the following but twas not successful: Dim fullName...
8
2221
by: farah727rash | last post by:
Hi all, I am trying to find the numerical value of a string that stores a two digit number. I have found the numerical value of a char as: char character; cin >character; int number =...
0
7126
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7005
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
6891
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
4916
isladogs
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...
0
3096
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3087
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1424
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
659
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
293
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.