Use std by row (axis=1):

df['stdDev'] = df[['A', 'B', 'C', 'D']].std(axis=1)

output:

  Key  A  B   C   D    stdDev
0   X  1  2   3   4  1.290994
1   y  4  5   6   7  1.290994
2   z  8  9  10  11  1.290994
Answer from mozway on Stack Overflow
🌐
Pandas
pandas.pydata.org › docs › reference › api › pandas.DataFrame.std.html
pandas.DataFrame.std — pandas 3.0.6 documentation
Return sample standard deviation over requested axis. Normalized by N-1 by default. This can be changed using the ddof argument. ... For Series this parameter is unused and defaults to 0. ... The behavior of DataFrame.std with axis=None is deprecated, in a future version this will reduce over both axes and return a scalar To retain the old behavior, pass axis=0 (or do not pass axis). ... Exclude NA/null values. If an entire row/column is NA, the result will be NA.
🌐
Vultr Docs
docs.vultr.com › python › third-party › pandas › DataFrame › std
Python Pandas DataFrame std() - Calculate Standard Deviation | Vultr Docs
December 24, 2024 - Select a specific column from the DataFrame. Call the std() method on this column to find its standard deviation. ... This snippet computes the standard deviation of the scores column, providing insights into the variance of the scores.
🌐
Data Science Parichay
datascienceparichay.com › home › blog › pandas – get standard deviation of one or more columns
Pandas - Get Standard Deviation of one or more Columns - Data Science Parichay
November 15, 2021 - You can use the pandas series std() function to get the standard deviation of a single column or the pandas dataframe std() function for the entire dataframe.
🌐
Statology
statology.org › home › how to calculate standard deviation in pandas (with examples)
How to Calculate Standard Deviation in Pandas (With Examples)
September 27, 2021 - The standard deviation of the ‘points’ column is 6.1586 and the standard deviation of the ‘rebounds’ column is 2.5599.
🌐
Javatpoint
javatpoint.com › pandas-standard-deviation
Pandas Standard Deviation - javatpoint
Pandas While working with the DataFrame in Pandas, you need to find the unique elements present in the column. For doing this, we have to use the unique() method to extract the unique values from the columns. The Pandas library in Python can easily help us... ... Pandas The value_counts() function returns a Series that contain counts of unique values.
🌐
CodeFatherTech
codefather.tech › home › blog › pandas standard deviation: analyse your data with python
Pandas Standard Deviation: Analyse Your Data With Python
June 22, 2025 - The Pandas DataFrame std() function allows to calculate the standard deviation of a data set. The standard deviation is usually calculated for a given column and it’s normalised by N-1 by default.
🌐
W3Schools
w3schools.com › python › pandas › ref_df_std.asp
Pandas DataFrame std() Method
import pandas as pd data = [[10, 18, 11], [13, 15, 8], [9, 20, 3]] df = pd.DataFrame(data) print(df.std()) Try it Yourself » · The std() method calculates the standard deviation for each column.
Find elsewhere
🌐
Medium
medium.com › @amit25173 › understanding-pandas-dataframe-std-90f742cc9d3a
Understanding pandas.DataFrame.std() | by Amit Yadav | Medium
March 6, 2025 - By default, pandas std() calculates the standard deviation column-wise. This means it looks at each column separately and computes the spread of numbers in that column.
🌐
Educative
educative.io › answers › how-to-calculate-the-standard-deviation-using-pandas
How to calculate the standard deviation using Pandas
Standard deviation is calculated using the function .std(). However, the Pandas library creates the Dataframe object and then the function .std() is applied on that Dataframe. The following code calculates the standard deviation of three columns ...
🌐
TutorialsPoint
tutorialspoint.com › python-calculate-the-standard-deviation-of-a-column-in-a-pandas-dataframe
Python - Calculate the standard deviation of a column in a Pandas DataFrame
# # Python - Calculate the Standard Deviation of column values of a Pandas DataFrame # import pandas as pd # Create DataFrame1 dataFrame1 = pd.DataFrame( { "Car": ['BMW', 'Lexus', 'Audi', 'Tesla', 'Bentley', 'Jaguar'], "Units": [100, 150, 110, 80, 110, 90] } ) print"DataFrame1 ...\n",dataFrame1 # Finding Standard Deviation of "Units" column values print"Standard Deviation of Units column from DataFrame1 = ",dataFrame1['Units'].std() # Create DataFrame2 dataFrame2 = pd.DataFrame( { "Product": ['TV', 'PenDrive', 'HeadPhone', 'EarPhone', 'HDD', 'SSD'], "Price": [8000, 500, 3000, 1500, 3000, 4000] } ) print"\nDataFrame2 ...\n",dataFrame2 # Finding Standard Deviation of "Price" column values print"Standard Deviation of Price column from DataFrame2 = ",dataFrame2['Price'].std()
🌐
TutorialsPoint
tutorialspoint.com › article › how-to-find-the-standard-deviation-of-specific-columns-in-a-dataframe-in-pandas-python
How to find the standard deviation of specific columns in a dataframe in Pandas Python?
December 10, 2020 - Let's create a DataFrame and calculate the standard deviation of specific columns ? import pandas as pd my_data = { 'Name': pd.Series(['Tom', 'Jane', 'Vin', 'Eve', 'Will']), 'Age': pd.Series([45, 67, 89, 12, 23]), 'Value': pd.Series([8.79, 23.24, 31.98, 78.56, 90.20]) } print("The dataframe is:") my_df = pd.DataFrame(my_data) print(my_df) print("\nThe standard deviation of column 'Age' is:") print(my_df['Age'].std()) print("\nThe standard deviation of column 'Value' is:") print(my_df['Value'].std())
🌐
Easy Tweaks
easytweaks.com › pandas-standard-deviation-std-columns
Get the Standard deviation of Pandas columns, rows and ...
December 29, 2021 - Master meetings, chats, channels and online collaboration · Go beyond the basics in Word, Excel, PowerPoint and Outlook
🌐
Pandas
pandas.pydata.org › pandas-docs › stable › reference › api › pandas.DataFrame.std.html
pandas.DataFrame.std — pandas 3.0.5 documentation
Return sample standard deviation over requested axis. Normalized by N-1 by default. This can be changed using the ddof argument. ... For Series this parameter is unused and defaults to 0. ... The behavior of DataFrame.std with axis=None is deprecated, in a future version this will reduce over both axes and return a scalar To retain the old behavior, pass axis=0 (or do not pass axis). ... Exclude NA/null values. If an entire row/column is NA, the result will be NA.
🌐
Programiz
programiz.com › python-programming › pandas › methods › std
Pandas std()
In this example, we calculated the standard deviation of the values in column A. import pandas as pd data = {'A': [1, 3, 5, 7], 'B': [2, 4, 6, 8]} df = pd.DataFrame(data) # calculate the standard deviation with ddof=0 std_dev_ddof_0 = df.std(ddof=0) print(std_dev_ddof_0)
🌐
Finxter
blog.finxter.com › home › learn python blog › 5 best ways to calculate the standard deviation of a column in a pandas dataframe
5 Best Ways to Calculate the Standard Deviation of a Column in a Pandas DataFrame - Be on the Right Side of Change
March 5, 2024 - The standard deviation is then extracted from this summary by locating (‘std’) for the “scores” column. If you prefer a more generic and customizable approach, you can use a lambda function within the apply() method to compute the standard deviation. ... import pandas as pd # Sample DataFrame data = {'scores': [10, 20, 30, 40, 50]} df = pd.DataFrame(data) # Calculate standard deviation using a lambda function std_deviation_lambda = df.apply(lambda x: x.std()) print(std_deviation_lambda['scores'])
🌐
Finxter
blog.finxter.com › home › learn python blog › 5 best ways to find the standard deviation of specific columns in a pandas dataframe
5 Best Ways to Find the Standard Deviation of Specific Columns in a Pandas DataFrame - Be on the Right Side of Change
March 9, 2024 - The std() function in Pandas computes the standard deviation of a DataFrame or specific columns within it. For a Series containing numeric data, the std() function calculates the standard deviation of the elements.