I'm very new to Mathematica. I'm just trying to plot some data, but Mathematica says there isn't a 7th element my data which is an array of 7 elements. The code before the plot is here:
x = Import["C:\\Useres\\PC\\Documents\\alt.csv","Table"];
a = x[[;;,7]];
tmp = x[[;;, 1;;6]];
dt = DateObject[tmp];
Mathematica also says it cannot take positions 1 through 6 in the first row of my data. I have to be doing something wrong, but I have no idea what.
I've searched as much as I could to find out what's wrong, but everything I find on Mathematica is super technical jargon I don't understand and irrelevant to my issue besides.
Any help would be appreciated.
Edit
x
is a file with 16,382 rows and 7 columns. The first six columns are the date and time, and the last is altitude. The interval between rows is one second.
x
? $\endgroup$x
? Please post a complete code that allows to fully reproduce your issue. For examples, itx
is a string your code won't work. $\endgroup$x = {2018, 09, 27, 12, 13, 50, 153.2}
,;;
is equivalent toAll
which is whyx[[;;,7]]
generates an error. Why not justx[[7]]
orx[[1 ;; 6]]
. If you had a list of lists then the form you are using would apply. e.g.{x, x}[[;; , 7]]
. $\endgroup$Dimensions[x]
? $\endgroup$