kogeh
(H. Koge)
1
Hello, I am usually MATLAB user.
I am considering switching from MATLAB to Mathematica.
Now please help me, I am very struggling to import time series csv in Mathematica.
Very first step for users except me, but it takes too many time…
The data format is
2020, 10, 27, 3, 45, 14.579, 38.1726, 143.41, 3390., 47071, 9999, -7711.6, -22813.8, 47340.9, 93.54, -0.4, -0.31
…
First 1-6 is YYYY,MM,DD,hh,mm,ss, and followings are each sensor data.
I cannot found how to import this data and plot.
rolfm
(Rolf Mertig)
2
Try this for a start:
FILENAME = "test.csv";
Column[
MapIndexed[DateListPlot[{#1}, PlotLabel -> Row[{"Column ", First[#2]}]] & ,
First[
Import[
FILENAME, {"CSV", "Data"}
] ] /. {yyyy_Integer, MM_, dd_, hh_, mm_, ss_, (data__)?NumberQ} :>
Thread[{DateObject[{yyyy, MM, dd, hh, mm, ss}], {data}}]]]
kogeh
(H. Koge)
3
I appreciate to your help.
But I cannot find where the data was imported and the values…
It will take long time…
The answer from Rolf imports and plots the data in one step. To just import the data
data = First[Import[FILENAME, {"CSV", "Data"}]] /.
{yyyy_Integer, MM_, dd_, hh_, mm_, ss_, (data__)?NumberQ} :>
Thread[{DateObject[{yyyy, MM, dd, hh, mm, ss}], {data}}]