How to get rid of row numbers, pd.read_excel?
Question: I am a complete beginner with Python. I am working on a assignment and I can't
seem to figure out how to get rid of the _row numbers_ from my excel
spreadsheet, while using `import pandas`.

This is what I get when I run the code:

    
    
    0   $20,000,000 $159,000,000  
    1    $9,900,000  $35,600,000  
    2   $35,000,000  $45,000,000  
    3    $9,900,000  $35,600,000  
    4   $12,000,000   $9,400,000 
    

But instead I just want:

    
    
    $20,000,000  $159,000,000  
    $9,900,000   $35,600,000  
    $35,000,000  $45,000,000  
    $9,900,000   $35,600,000  
    $12,000,000  $9,400,000 
    

This is inside of my main block for formatting:

    
    
    if __name__ == "__main__":
        file_name = "movie_theme.xlsx"    
    
        # Formatting numbers (e.g. $1,000,000)
        pd.options.display.float_format = '${:,.0f}'.format
    
        # Reading Excel file
        df = pd.read_excel(file_name, convert_float = False)
    

Any suggestions on how to go about doing this?


Answer: Internally your dataframe always needs an index. If you get rid of the integer
index another column has to be your index and you should only use a data
column as your index if you need to for some special purpose.

When you write your dataframe to a file, e.g. with the `to_csv()` method, you
can always specify the keyword `index=False` and you won't get that index
written to your output.

