2
$\begingroup$

I am importing data from Excel with the code Import["/Users/....\ xlsx"] and I what I get is a list such as {0., 6., 11., 14., 16., 21., 22., 25., 32., 33., 34., 46., 61., 70., \ 73., 78., 88., 89., 90., 95.}

Why do the numbers have a dot after? This is causing some problems when I am trying to analyze the data, since SameQ[61., 61] gives false.

Any ideas on how to import the numerical values only?

$\endgroup$
4
  • 1
    $\begingroup$ I do not have excel, but isn't real numbers how excel internally store these as? any way, you could also always make these numbers exact after importing them. something like = {0., 6., 11., 14., 16., 21., 22., 25., 32., 33., 34., 46., 61.,70., 73., 78., 88., 89., 90., 95.}; then SetAccuracy[L, Infinity] which gives {0, 6, 11, 14, 16, 21, 22, 25, 32, 33, 34, 46, 61, 70, 73, 78, 88, 89, 90, 95} screen shot !Mathematica graphics $\endgroup$
    – Nasser
    Commented Dec 26, 2022 at 21:18
  • $\begingroup$ There seems to be similar question here also importing-numbers-from-excel $\endgroup$
    – Nasser
    Commented Dec 26, 2022 at 21:21
  • $\begingroup$ This too With[{r = Round[#]}, r + Chop[# - r]] & /@ Import["/Users/....\ xlsx"] $\endgroup$ Commented Dec 26, 2022 at 21:42
  • $\begingroup$ Thank you for the answers! Round or Floor do what I wanted!! $\endgroup$ Commented Dec 27, 2022 at 1:02

0

Browse other questions tagged or ask your own question.