how to return values from map function on dataframe

80 Views Asked by At

I am trying to return values from map function but instead it gives me the memory address. I tried using list, but then it gives me an error stating str object doesn't have an attribute decode. Is there a way out?

1

There are 1 best solutions below

1
On

The first problem you mentioned is probably because you are accessing an objects name rather than applying a method.

But for this error Error: AttributeError: 'str' object has no attribute 'decode'

This error is already answered in here 'str' object has no attribute 'decode'. Python 3 error?

As it said here you are trying to decode an object that is already decoded. You have a str, there is no need to decode from UTF-8 anymore. If you remove the .decode() method from your chain it will be ok.