How to perform element wise functioning in a Data frame of a python?

ipython

#1

I have created a function in ipython notebook and tried to apply the function on a Data frame but while applying it I got a error…

Here the function compute a formatted string from each floating point value in frame.
the Data frame is

frame = DataFrame(np.random.randn(4, 3), columns=list('bde'),
.....: index=['Utah', 'Ohio', 'Texas', 'Oregon']).

I want to know how to remove this error for implementation of this function on this Data frame.

Thanks
Sid


#2

Hi @sid100158,

Do this -

frame.applymap(format)

Regards,
Aayush