Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

Comments

  1. DataFrame.replace works different from DataFrame.update.

import pandas as pd
df = pd.DataFrame({"x": [1, 2, 3, 4, 5], "y": [5, 4, 3, 2, 1]})
df
Loading...
df.x[df.x < 3] = 1000
df
Loading...
df.y.replace(5, 5000, inplace=True)
df
Loading...