How to call value from excel on python
<p>I'm currently trying to refer to a value from an excel spreadsheet that is full of passenger data for the titanic disaster. Here is the part I'm stuck on.</p>

<blockquote>
  <p>Examining the survival statistics, a large majority of males did not
  survive the ship sinking. However, a majority of females did survive
  the ship sinking. Let's build on our previous prediction: If a
  passenger was female, then we will predict that they survived.
  Otherwise, we will predict the passenger did not survive. Fill in the
  missing code below so that the function will make this prediction.</p>
  
  <p>Hint: You can access the values of each feature for a passenger like a
  dictionary. For example, passenger['Sex'] is the sex of the passenger.</p>
</blockquote>

<pre><code>def predictions_1(data):
    """ Model with one feature: 
            - Predict a passenger survived if they are female. """

    predictions = []
    for _, passenger in data.iterrows():

        # Remove the 'pass' statement below 
        # and write your prediction conditions here
        if passenger['Sex'] == 'female':
            survived == 1
        else survived == 0

    # Return our predictions
    return pd.Series(predictions)
â
# Make the predictions
predictions = predictions_1(data)


  File "&lt;ipython-input-75-6b2fca23446d&gt;", line 12
    else survived == 0
                ^

SyntaxError: invalid syntax
</code></pre>

<p>I input the if else statement and I'm positive there are many errors in my attempt, I'd appreciate some clarity to how to fix this, the data from the excel sheet is the survived and sex data. Here is the github link to the project I'm working on. 
<a href="https://github.com/udacity/machine-learning/tree/master/projects/titanic_survival_exploration" rel="nofollow">https://github.com/udacity/machine-learning/tree/master/projects/titanic_survival_exploration</a></p>

<p>Your syntax is not correct with that <code>else</code> missing a <code>:</code>, and you're mixing the <a href="https://docs.python.org/2/library/stdtypes.html#comparisons" rel="nofollow"><em>equality operator</em> <code>==</code></a> with the <a href="https://docs.python.org/2/reference/simple_stmts.html#assignment-statements" rel="nofollow"><em>assignment operator</em> <code>=</code></a>:</p>

<pre><code>    if passenger['Sex'] == 'female':
        survived = 1 # bind int value 1 to the name 'survived'
    else: 
        survived = 0
</code></pre>

python excel pandas