1
$\begingroup$

I'm apologize for the stupidity of this question, but I've run out of ideas. I have some data saved in a mx file. When imported, MM isn't treating the values as numbers.

For instance: Freedonia = Import["dataFreedonia.mx"] // Dataset;

This imports the data:

Import data

So far so good. But when I do something as basic as take a mean:

Mean value

It is like it doesn't understand that the two values are numbers. So I tested that:

NumberQ

I've also tried using ToExpression in case it thought the values were strings; that failed.

Anyone have any ideas?

EDIT

In response to the comment by J.M., I've tried to replace the scientific form using the Identity function. This still doesn't seem to solve the issue, but it does seem that we are on the right track:

Using Identity

$\endgroup$
  • 3
    $\begingroup$ What does FullForm[Freedonia[1, 2]] return? $\endgroup$ – J. M. will be back soon May 11 '16 at 14:42
  • $\begingroup$ martinky is likely correct. But, it should be noted that NumberQ is more restrictive than NumericQ as NumberQ[Pi] is False. But, that isn't likely to apply in this case. $\endgroup$ – rcollyer May 11 '16 at 14:55
  • $\begingroup$ J.M.: ScientificForm[0.03958551390946177`,5] $\endgroup$ – tazz_ben May 12 '16 at 12:46
  • 1
    $\begingroup$ Well, that's why you're having problems. Try making the replacement Freedonia /. ScientificForm -> Identity and report back. $\endgroup$ – J. M. will be back soon May 13 '16 at 13:56
  • 2
    $\begingroup$ Hmm, I forgot the exact form of ScientificForm[] for some reason; anyway, the replacement rule ought to have been Freedonia /. ScientificForm[n_, rest___] -> n. Try that, please. $\endgroup$ – J. M. will be back soon May 14 '16 at 17:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.