Proper Input of file and checking the list
Make sure that the variable list
does contain your file inputs and make sure that Mathematica correctly understands your numbers. For this you might try:
list = SemanticImport[ "myfile.txt", "Number", "List" ]
or using ReadList
you might try:
list = ReadList[ "myfile.txt", "Number" ]
Then check whether there still is anything besides numeric quantities:
list // Map[ NumericQ] // Apply[And]
If everything is ok, then you should see True
as a result.
To further ponder the Plus
problem you should check for what exactly happens by looking at the result of:
Select[ list, Head[#] == Plus & ][[1]] // FullForm
As we have discussed in the comments here, you probably have read in some number like "10e+3" which causes problems if not addressed by giving the type as in above uses of SemanticImport
or ReadList
.
Finding the Max and Min anyway
If your result was False
you may get some result anyway but simply just selecting the numeric elements:
list // RightComposition[
Select[NumericQ],
Through[{Max, Min}[#]] &
]
Fixing the Plus expressions returned for floats
To address the problem of Plus
given for exponential numbers you may also try:
list = list /. Plus[ exp_ , Times[ coef_, e ] ] :> coef \[Times] 10.^exp
That should take care of the false representation using ReadList
without giving the type "Number".
myList[[ 1 ;; 10 ]]
or by usingShort
) ? $\endgroup$