Source code for CPAC.utils.create_group_analysis_info_files
[docs]defwrite_design_matrix_csv(patsy_dmatrix,participant_column,column_names,outfile_path):importpandasaspdtry:# TODO# patsy dmatrix might actually already be a dataframe- rename this# variable pleasepatsy_dmatrix.to_csv(outfile_path)except:group_model_dataframe=pd.DataFrame(data=patsy_dmatrix,index=participant_column,columns=column_names)group_model_dataframe.to_csv(outfile_path)
# except Exception as e:# err = "\n\n[!] Could not write the design matrix dataframe to the " \# "CSV file: %s\n\nError details: %s\n\n" % (outfile_path, e)# raise Exception(err)