class_docstr: Simple class to handle the experimental paradigm in one session
      
docstr: Write the paradigm to a csv file
  
  Parameters
  ----------
  csv_file: string, path of the csv file
  session: string, optional, session identifier
docstr_tok: ["Write","the","paradigm","to","a","csv","file","Parameters","--","--","--","--","--","csv_file",":","string",",","path","of","the","csv","file","session",":","string",",","optional",",","session","identifier"]
code: def write_to_csv(self, csv_file, session="0"):
      """Write the paradigm to a csv file
  
      Parameters
      ----------
      csv_file: string, path of the csv file
      session: string, optional, session identifier
      """
      import csv
  
      with open(csv_file, "w", newline="") as fid:
          writer = csv.writer(fid, delimiter=" ")
          n_pres = np.size(self.con_id)
          sess = np.repeat(session, n_pres)
          pdata = np.vstack((sess, self.con_id, self.onset)).T
  
          # add the duration information
          if self.type == "event":
              duration = np.zeros(np.size(self.con_id))
          else:
              duration = self.duration
          pdata = np.hstack((pdata, np.reshape(duration, (n_pres, 1))))
  
          # add the amplitude information
          if self.amplitude is not None:
              amplitude = np.reshape(self.amplitude, (n_pres, 1))
              pdata = np.hstack((pdata, amplitude))
  
          # write pdata
          for row in pdata:
              writer.writerow(row)
  
file_path: nipy/nipy/modalities/fmri/experimental_paradigm.py
imports: import numpy
label_desc: Use image node_id 2 for calling the Paradigm obj's underlying member method code with example usage: obj.write_to_csv(csv_file, session) without return types