I have an integer dataframe and in my code I am doing some length calculation( which can be only perfomred on string), therefore I need to convert my dataframe to String. I have tried using str(), its not helping me, it would be helpful if you could suggest something.
Taruna_1
0
Newbie Poster
Recommended Answers
Jump to PostGive us an example of a dataframe.
Jump to PostApparently, you are using pandas DataFrame instances. The api reference for these objects contains conversion methods. I would try
s = df.to_string()
All 6 Replies
vegaseat
1,735
DaniWeb's Hypocrite
Team Colleague
Taruna_1
0
Newbie Poster
Gribouillis
1,391
Programming Explorer
Team Colleague
Taruna_1
0
Newbie Poster
Gribouillis
1,391
Programming Explorer
Team Colleague
Taruna_1
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.