title: Is index function in to_csv I have used correctly according to problem statement?
body: <blockquote>
    <p>Problem Statement :</p>
    
    <p>1) Create another Series named heights_B from a 1-D numpy array of 5 elements derived from the normal distribution of mean    170.0 and standard deviation 25.0.</p>
    
    <p>Note: Set random seed to 100 before creating heights_B series. Use numpy.</p>
    
    <p>2) Create another Series named weights_B from a 1-D numpy array of 5 elements derived from the normal distribution of mean    75.0 and standard deviation 12.0.</p>
    
    <p>Note: Set random seed to 100 again before creating weights_B series. Use numpy.</p>
    
    <p>3)Label both Series elements with s1, s2, s3, s4 and s5. </p>
    
    <p>4)Create a dataframe df_B containing the height and weight of students s1, s2, s3, s4 and s5 belonging to class B.</p>
    
    <p>5)Label the columns as Student_height and Student_weight respectively.</p>
    
    <p>Write the contents of df_B without the index to a CSV file named classB.csv.</p>
    
    <p>Note: Use the index argument of to_csv method.</p>
    
    <p>Solution :</p>
  </blockquote>
  
  <pre><code>import pandas as pd
  import numpy as np
  import random
  height_A=np.array([176.2,158.4,167.6,156.2,161.4])
  s1=pd.Series(height_A,index=['s1','s2','s3','s4','s5'])
  weight_A=np.array([85.1,90.2,76.8,80.4,78.9])
  s2=pd.Series(weight_A,index=['s1','s2','s3','s4','s5'])
  df={'Student_height':s1,'Student_weight':s2}
  hdf=pd.DataFrame(df)
  random.seed(100)
  x=np.random.normal(loc=170.0,scale=25.0,size=5)
  s3=pd.Series(x,index=['s1','s2','s3','s4','s5'])
  random.seed(100)
  y=np.random.normal(loc=75.0,scale=12.0,size=5)
  s4=pd.Series(y,index=['s1','s2','s3','s4','s5'])
  df1=df={'Student_height':s3,'Student_weight':s4}
  hdf1=pd.DataFrame(df1)
  hdf1.to_csv('classB.csv',index=False)
  </code></pre>
  
  <blockquote>
    <p>I have written code according to problem statement but online compiler is not accepting my solution , please tell me if I have done any mistake.</p>
  </blockquote>