Difficulty With Applying DataFrame.replace()

Sample of 3 Entries from the Books DataFrame
Data Type of “Ratings”
Data Type of “Ratings” Unchanged
Create a List of ‘Ratings’
Check for Commas in ‘Ratings’
str.replace(old, new[, count])
Examples of str.replace()
DataFrame.replace(to_replace=None, value=None, inplace=False, limit=None, regex=False, method=’pad’)
First Attempt is Unsuccessful
Second Attempt, Slight Change to Syntax, is Not Successful Either
Third Attempt, with an EXACT string, is Not Successful Either
Success! No Commas in ‘Ratings’ Column
Viewing the Values in ‘iRatings’




Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Shared Pipeline Libraries To Deploy Microservices

Synergies in Software Development

There’s Always Cache in the Banana Stand

Microsoft Teams — Comparing Cloud Video Interop Services

Dockerize a Django Project in Just 5 minute.

My Time in Lambda School iOS Labs

mDevCamp Conference 2019 Review

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Annika Noren

Annika Noren

More from Medium

Maut Method in Multi Criteria Decision Making with Python

Mutable and Immutable Objects in Python

Python Decorator

Arithmetic Operators in Python