i want to compare my sum of Q2 with the sum of all individual account
<p>I want my option 3 work out. I want to compare the sum of Apr, May, Jun with the sum of every individual accounts. (sum of column compare to sum of axis) I keep getting the series lengths must match to compare</p>

<pre><code>import pandas as pd

if __name__ == "__main__":   
    file_name = "sales_rossetti.xlsx"    

# Formatting numbers (e.g. $1,000,000)
pd.options.display.float_format = '${:,.0f}'.format

# Reading Excel file
df = pd.read_excel(file_name, index_col = 0, convert_float = False)
print ("Welcome to Rossetti's Sales program\n")  
print ("1) Search by State")
print ("2) Search by Jan Sales")
print ("3) Search by Q2 sales")
print ("4) Exit")

my_option = input ("Please select a menu option:")


if (my_option=="3"):
    my_columns = ["Apr","May","Jun"] 
    all_columns = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]
    your_sales = input ("Please enter your minimum sale: ")
    print (df[my_columns].sum()&lt;df[all_columns].sum(axis=1, skipna=None, level=None, numeric_only=True))'
</code></pre>

<p>Error message is:"
  File "C:\Users\jay\Anaconda3\lib\site-packages\pandas\core\ops.py", line 735, in wrapper
    raise ValueError('Series lengths must match to compare')</p>

<p>ValueError: Series lengths must match to compare"</p>

<p>If you print out the result of <code>df[my_columns].sum()</code> and <code>df[all_columns].sum(axis=1, skipna=None, level=None, numeric_only=True)</code> you would probably be able to debug it for yourself.</p>

<p>My guess is that because you have different values for skipna the first series has dropped some rows so you cannot compare them directly.</p>

python pandas