title: How to split a large excel file into multiple worksheets based on their given ip address using pandas python
body: <p>I'm new to pandas and python so ran into some trouble. I have a one large excel file which i need to divide into multiple worksheets using a python script. That i have to divide base on the ip addresses given in the data. I can't figure out how to do that and would appreciate some help and guidance. 
  I have no knowledge of working with python or any libraries before. This is what i did but created workbooks for each row.</p>
  
  <pre><code>import pandas as pd
  df = pd.read_excel("D:/Users/Zakir/Desktop/MyNotebooks/Legacy.xls", sheet_name="Total", header=0, names=None, index_col=None, parse_cols=None, usecols=None, squeeze=False, dtype=None, engine=None, converters=None, true_values=None, false_values=None, skiprows=None, nrows=None, na_values=None, keep_default_na=True, verbose=False, parse_dates=False, date_parser=None, thousands=None, comment=None, skipfooter=0, convert_float=True, mangle_dupe_cols=True)
  
  writer = pd.ExcelWriter('D:/Users/Zakir/Desktop/MyNotebooks/pandas_simple.xlsx', engine='xlsxwriter')
  for index, row in df.iterrows():
      df1 = df.iloc[[index]]
      df1.set_index('Number',inplace=True)
      df1.to_excel(writer,  sheet_name=row['IPAddress'])
  writer.save()
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/lw0vt.png" rel="nofollow noreferrer">This is the kind of excel file i have. over 5000 rows. There are 60 groups of ip addresses and have to divide each group into its own worksheet</a></p>