How can I open an Excel file in Python?

Edit:In the newer version of pandas, you can pass the sheet name as a parameter. Check the docs for examples on how to pass sheet_name:https://pandas.pydata.org/pandas-docs/stable/generated/pandas.read_excel.html Old version:you can use pandas package as well…. When you are working with an excel file with multiple sheets, you can use: df.head() will print first 5 rows of your Excel file If you’re working … Read more

min() arg is an empty sequence

If you want to avoid this ValueError in general, you can set a default argument to min(), that will be returned in case of an empty list. See described here. Note that this only works in Python 3.4+

Pop index out of range

To get the final value of a list pop’ed, you can do it this way: Keep in mind that pop removes the item, and the list changes length after the pop. Use negative numbers to index from the end of a list that may be changing in size, or just use pop() with no arguments for the … Read more

ImportError: No Module Named bs4 (BeautifulSoup)

Activate the virtualenv, and then install BeautifulSoup4: When you installed bs4 with easy_install, you installed it system-wide. So your system python can import it, but not your virtualenv python. If you do not need bs4 to be installed in your system python path, uninstall it and keep it in your virtualenv. For more information about virtualenvs, read this