You need to select that column:

In [41]:
df.loc[df['First Season'] > 1990, 'First Season'] = 1
df

Out[41]:
                 Team  First Season  Total Games
0      Dallas Cowboys          1960          894
1       Chicago Bears          1920         1357
2   Green Bay Packers          1921         1339
3      Miami Dolphins          1966          792
4    Baltimore Ravens             1          326
5  San Franciso 49ers          1950         1003

So the syntax here is:

df.loc[<mask>(here mask is generating the labels to index) , <optional column(s)> ]

You can check the docs and also the 10 minutes to pandas which shows the semantics

EDIT

If you want to generate a boolean indicator then you can just use the boolean condition to generate a boolean Series and cast the dtype to int this will convert True and False to 1 and 0 respectively:

In [43]:
df['First Season'] = (df['First Season'] > 1990).astype(int)
df

Out[43]:
                 Team  First Season  Total Games
0      Dallas Cowboys             0          894
1       Chicago Bears             0         1357
2   Green Bay Packers             0         1339
3      Miami Dolphins             0          792
4    Baltimore Ravens             1          326
5  San Franciso 49ers             0         1003
Answer from EdChum on Stack Overflow
🌐
Pandas
pandas.pydata.org › docs › reference › api › pandas.DataFrame.replace.html
pandas.DataFrame.replace — pandas 3.0.5 documentation
Value to replace any values matching to_replace with. For a DataFrame a dict of values can be used to specify which value to use for each column (columns not in the dict will not be filled). Regular expressions, strings and lists or dicts of such objects are also allowed.
🌐
Spark By {Examples}
sparkbyexamples.com › home › pandas › pandas dataframe replace() – by examples
Pandas DataFrame replace() - by Examples - Spark By {Examples}
October 10, 2024 - pandas.DataFrame.replace() function is used to replace values in columns (one value with another value on all columns). It is a powerful tool for data
Discussions

python - Pandas DataFrame: replace all values in a column, based on condition - Stack Overflow
I have a simple DataFrame like the following: Team First Season Total Games 0 Dallas Cowboys 1960 894 1 Chicago Bears 1920 1357 2 Green Bay Packers 1921 1339 3 Miami Dolphins 1966 792 4 Baltimore R... More on stackoverflow.com
🌐 stackoverflow.com
Replacing certain values from entire columns of a pandas dataframe
Use the map method https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.map.html More on reddit.com
🌐 r/learnpython
2
1
June 28, 2021
Best way to replace values in one column from another column in pandas?
No, you shouldn't be looping. You should generally avoid that in Pandas. You can assign directly with loc: df.loc[df['new_items'] != 0, 'old_items'] = df['new_items'] or use an apply function: df['old_items'] = df.apply(lambda row: row['new_items'] if row['new_items'] != 0 else row['old_items']) More on reddit.com
🌐 r/learnpython
2
1
October 20, 2022
I need to replace NaN in one column with value for other col
I've seen this come up before. You want to use np.where. data['Grade'] = np.where(data['Grade'].isna(),data['Score'],data['Grade']) here's an example that sets null values in grade to values in score, and if it's not null, leaves the current value. More on reddit.com
🌐 r/learnpython
10
1
July 15, 2021
🌐
Favtutor
favtutor.com › articles › pandas-replace-column-values
Pandas DataFrame: Replace Column Values (with code)
December 15, 2023 - Learn how to replace column values in a Pandas DataFrame using replace, apply and loc methods with Python examples.
🌐
GeeksforGeeks
geeksforgeeks.org › data analysis › how-to-replace-values-in-column-based-on-condition-in-pandas
How to Replace Values in Column Based on Condition in Pandas? - GeeksforGeeks
November 15, 2024 - import pandas as pd # Data Student = { 'Name': ['John', 'Jay', 'sachin', 'Geetha', 'Amutha', 'ganesh'], 'gender': ['male', 'male', 'male', 'female', 'female', 'male'], 'math score': [50, 100, 70, 80, 75, 40], 'test preparation': ['none', 'completed', 'none', 'completed', 'completed', 'none'], } # Creating a DataFrame object df = pd.DataFrame(Student) # Replacing 'male' with 1 in the 'gender' column df.loc[df["gender"] == "male", "gender"] = 1 print(df) ... Name gender math score test preparation 0 John 1 50 none 1 Jay 1 100 completed 2 sachin 1 70 none 3 Geetha female 80 completed 4 Amutha female 75 completed 5 ganesh 1 40 none · We can replace values in Column based on Condition in Pandas using the following methods:
🌐
Data to Fish
datatofish.com › replace-values-pandas-dataframe
How to Replace Values in a pandas DataFrame
# replace one specific value in a column df['column_a'] = df['column_a'].replace("x", "y") # replace multiple values (x, y) with one value (z) in a column df['column_a'] = df['column_a'].replace(["x", "y"], "z") # replace values (w, x) with other values (y, z) in a column df['column_a'] = ...
Find elsewhere
🌐
Saturn Cloud
saturncloud.io › blog › pandas-how-to-change-all-the-values-of-a-column
How to Change All the Values of a Column in a Pandas DataFrame | Saturn Cloud Blog
May 1, 2026 - For example, if you have a DataFrame df with a column named age, you can select the column like this: ... Once you have selected the column, you can use the .apply() method to apply a function to each value in the column.
🌐
Note.nkmk.me
note.nkmk.me › home › python › pandas
pandas: Replace values in DataFrame and Series with replace() | note.nkmk.me
January 17, 2024 - Use the replace() method by specifying the original value as the first argument and the replacement value as the second. print(df.replace('CA', 'California')) # name age state point # 0 Alice 24 NY 64 # 1 Bob 42 California 24 # 2 Charlie 18 ...
🌐
Pandas
pandas.pydata.org › pandas-docs › version › 2.1 › reference › api › pandas.DataFrame.replace.html
pandas.DataFrame.replace — pandas 2.1.4 documentation
Value to replace any values matching to_replace with. For a DataFrame a dict of values can be used to specify which value to use for each column (columns not in the dict will not be filled). Regular expressions, strings and lists or dicts of such objects are also allowed.
🌐
GeeksforGeeks
geeksforgeeks.org › python-pandas-dataframe-replace
Python | Pandas dataframe.replace() - GeeksforGeeks
Pandas dataframe.replace() function is used to replace a string, regex, list, dictionary, series, number, etc. from a Pandas Dataframe in Python. Every instance of the provided value is replaced after a thorough search of the full DataFrame.
Published: July 11, 2024
🌐
Delft Stack
delftstack.com › home › howto › python pandas › pandas replace values in column
How to Replace Column Values in Pandas DataFrame | Delft Stack
February 2, 2024 - DataFrame’s columns are Pandas Series. We can use the Series.map method to replace each value in a column with another value. ... na_action: It is used for dealing with NaN (Not a Number) values.
🌐
Statology
statology.org › home › how to replace values in a pandas dataframe (with examples)
How to Replace Values in a Pandas DataFrame (With Examples)
September 27, 2022 - The following code shows how to replace multiple values in a single column: #replace 6, 11, and 8 with 0, 1 and 2 in rebounds column df['rebounds'] = df['rebounds'].replace([6, 11, 8], [0, 1, 2]) #view DataFrame print(df) team division rebounds 0 A E 1 1 A W 2 2 B E 7 3 B E 0 4 B W 0 5 C W 5 6 C E 12 · The following tutorials explain how to perform other common tasks in pandas:
🌐
Medium
medium.com › @whyamit101 › understanding-pandas-replace-function-c2b0b7709233
Understanding pandas replace() Function | by why amit | Medium
February 10, 2025 - Here’s an example where we replace the value 1 with 100 in one column: df = pd.DataFrame({'A': [1, 2, 3], 'B': [4, 5, 6]}) df = df.replace(1, 100) print(df) ... As you can see, the value 1 in column A was replaced by 100, while the rest of ...
🌐
Saturn Cloud
saturncloud.io › blog › how-to-replace-multiple-values-in-one-column-using-pandas
How to Replace Multiple Values in One Column using Pandas | Saturn Cloud Blog
May 1, 2026 - In this example, we used a dictionary as the value argument to replace the values apple and banana with the value fruit, and the value orange with the value citrus. Handling missing values before replacement is crucial to avoid unexpected behavior. Depending on the use case, you can either fill or drop missing values. import pandas as pd # Create a sample DataFrame data = {'Column1': [1, 2, 3, 4, 5, 6], 'Column2': ['A', 'B', 'C', 'D', 'A', 'C']} df = pd.DataFrame(data) # Introduce missing values df.loc[2, 'Column2'] = None # Attempt to replace values with missing values present replacement_dict = {'A': 'X', 'B': 'Y', 'C': 'Z'} df['Column3'] = df['Column2'].replace(replacement_dict) # Display the DataFrame to identify the issue print(df)
🌐
datagy
datagy.io › home › pandas tutorials › pandas dataframes › pandas replace() – replace values in pandas dataframe
Pandas replace() - Replace Values in Pandas Dataframe • datagy
March 2, 2023 - The Pandas .replace() method also allows you to use dictionaries to replace values. This can often be a convenient way of handling many replacements. However, it’s not my preferred approach as the behavior can often be difficult to read.
🌐
Spark By {Examples}
sparkbyexamples.com › home › pandas › pandas replace values based on condition
Pandas Replace Values based on Condition - Spark By {Examples}
June 18, 2025 - You can replace all values or selected values in a column of pandas DataFrame based on condition by using DataFrame.loc[], np.where() and DataFrame.mask()
🌐
Statology
statology.org › home › pandas: how to replace multiple values in one column
Pandas: How to Replace Multiple Values in One Column
September 27, 2022 - This tutorial explains how to replace multiple values in one column of a pandas DataFrame, including an example.