Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • 1
    $\begingroup$ Try: (Mean[Import[#,"Data"]][[All,2]])& /@ FileNames[...] $\endgroup$ Commented Apr 3, 2023 at 16:16
  • 1
    $\begingroup$ Consider this contrived example: (t1 = Table[ConstantArray[i, 10], {i, 15}]) // TableForm . Each column comes from one file. Then Mean /@ t1 would give you the mean across each row at a time that (I think) you want. $\endgroup$ Commented Apr 3, 2023 at 16:33
  • $\begingroup$ Amazing, thank you! Is there a way to drop the first row of each file before averaging? Throwing a Drop[...,1] in that command somewhere? $\endgroup$ Commented Apr 3, 2023 at 16:35
  • 1
    $\begingroup$ Mean /@ Rest@t1 will drop the first row. $\endgroup$ Commented Apr 3, 2023 at 16:36
  • 2
    $\begingroup$ try also Mean[Rest@Import[#, {"Data", All, 2}] & /@ files] (where files is your list of file names) $\endgroup$ Commented Apr 3, 2023 at 18:11