Create string variable from value in dataframe field pandas

Question:

A query that I have not managed to find and I’ve been trying for a while, how can I pass the value of a dataframe to a string variable without inheriting that is of type object? This is because I need to concatenate in a text certain values of a dataframe.

Let me explain:

v_addres = df_example['Addres']
print("Addres is " + v_addres)

The result is approximate, but it adds values for me.

"0    Addres is .... Name: Addres, dtype: object"

How can I keep only the value of the field?

I want see some this:

"Addres is Av. Springfield 178."

Thank you very much.

Best regards

Asked By: Gonza

||

Answers:

try this
if you make the example reproducible, i’ll be able to share the resut

df_example['Addres'][0]
Answered By: Naveed
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.