You can use .std(axis=1) [pandas-doc] instead, this will result in a Series with as indices the indices of your dataframe, and as values, the standard deviation of the two values in the corresponding columns:

>>> df.std(axis=1)
0    1.414214
1    2.687006
2    1.626346
3    1.223295
4    1.025305
5    1.732412
6    1.965757
dtype: float64
Answer from willeM_ Van Onsem on Stack Overflow
🌐
Statology
statology.org › home › pandas: how to calculate standard deviation for each row
Pandas: How to Calculate Standard Deviation for Each Row
January 5, 2023 - The argument axis=1 tells pandas to perform the calculation for each row (instead of each column) and numeric_only=True tells pandas to only consider numeric columns when performing the calculation.
🌐
Arab Psychology
scales.arabpsychology.com › home › how do you calculate the standard deviation for each row in a pandas dataframe?
How Do You Calculate The Standard Deviation For Each Row In A Pandas DataFrame?
November 22, 2025 - To correctly calculate the standard deviation for each row, we must include two critical arguments within the method call. The first argument, axis=1, instructs pandas to perform the calculation horizontally across the DataFrame, aggregating values within each row.
🌐
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.
🌐
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 - #calculate standard deviation of all numeric columns df.std() points 6.158618 assists 2.549510 rebounds 2.559994 dtype: float64 · Notice that pandas did not calculate the standard deviation of the ‘team’ column since it was not a numeric column.
🌐
Skytowner
skytowner.com › explore › pandas_dataframe_std_method
Pandas DataFrame | std method with Examples
Pandas DataFrame.std(~) method computes the standard deviation of each row or column of the source DataFrame.
🌐
Statistics Globe
statisticsglobe.com › home › python programming language for statistics & data science › standard deviation in python (5 examples)
Standard Deviation in Python (Example) | List, DataFrame Column & Row
October 4, 2022 - In this section, I’ll explain ... of a pandas DataFrame. ... print(data.std(axis = 1)) # Get standard deviation of rows # x1 9.521905 # x2 2.516611 # x3 4.760952 # dtype: float64 · As you can see, the previous Python code has returned a standard deviation value for each of our float ...
🌐
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.
🌐
Medium
medium.com › @amit25173 › understanding-pandas-dataframe-std-90f742cc9d3a
Understanding pandas.DataFrame.std() | by Amit Yadav | Medium
March 6, 2025 - Since the difference between the two numbers in each row is always 5, the standard deviation is consistent across all rows. ... Real-world data isn’t always neat. Missing values (NaN) can sneak in. By default, pandas std() skips these NaN values.
Find elsewhere
🌐
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
🌐
Arabpsychology
statistics.arabpsychology.com › psychological statistics › understanding row-wise standard deviation calculation using pandas
Understanding Row-Wise Standard Deviation Calculation Using Pandas - PSYCHOLOGICAL STATISTICS
February 8, 2026 - The key to performing row-wise ... the function across the rows). By setting axis=1, we instruct the .std() function to iterate over the columns for each row, yielding the row-level standard deviation....
🌐
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.
🌐
EDUCBA
educba.com › home › software development › software development tutorials › pandas tutorial › pandas std()
Pandas std() | How does std() Function Work in Pandas?
April 14, 2023 - In the above program, we first import the pandas library and the NumPy library and then define the dataframe in the name of data. Then we use the std() function to call this data. The std() function gives the final standard deviation of all ...
Address: Unit no. 202, Jay Antariksh Bldg, Makwana Road, Marol, Andheri (East),, 400059, Mumbai
🌐
Spark Code Hub
sparkcodehub.com › pandas › data analysis › std method
Std Method | PANDAS Tutorial | Spark Code Hub
This computes the standard deviation across columns for each row, showing how sales vary across branches in each month. The first month has the highest variability (25.17), suggesting diverse performance.
🌐
DataScience Made Simple
datasciencemadesimple.com › home › standard deviation function in python pandas (dataframe, row and column wise standard deviation)
Standard deviation Function in Python pandas (Dataframe, Row and column wise standard deviation) - DataScience Made Simple
December 25, 2020 - axis=0 argument calculates the column wise standard deviation of the dataframe so the result will be · Score1 17.446021 Score2 17.653225 Score3 14.355603 dtype: float64 · # Row standard deviation of the dataframe df.std(axis=1)
🌐
W3Schools
w3schools.com › python › pandas › ref_df_std.asp
Pandas DataFrame std() Method
import pandas as pd data = [[10, ... deviation for each column. By specifying the column axis (axis='columns'), the std() method searches column-wise and returns the standard deviation for each row....
🌐
Spark Code Hub
sparkcodehub.com › pandas › data analysis › std method
Mastering the Standard Deviation Method in Pandas
This computes the standard deviation across columns for each row, showing how sales vary across branches in each month. The first month has the highest variability (25.17), suggesting diverse performance.