问题
I have a .csv file and it contains thousands of rows. I collected this data file as output of running my program for 60 minutes. This output file contains time column (in forum HH:MM:SS:MS), this time column is recording time for my outputs. I want to get plot of my other columns in my output.csv file according to my time column (taking the results for all columns every 1 minutes).
For example:
I have a row like this:
Data Time
----- -----
455 10:00:00
894 10:00:00
785 10:00:00
898 10:00:01
789 10:00:01
748 10:00:02
248 10:00:02
788 10:00:02
148 10:00:02
742 10:00:02
... ...
266 10:01:00
... ...
Is there any easy way to plot other columns with rows according to time column (taking the results for all columns every 1 minutes) ?
回答1:
While the question is not completely clear/consistent, I understand you want to count the number of data for each of the first 15 intervals
10:00 <= time < 10:01
etc.
For the first interval, you can use
=SUMPRODUCT(($B$2:$B$8>=TIME(10;0;0))*($B$2:$B$10000<TIME(10;1;0)))
I assume your time data is in B2:B10000.
You can expand this range as needed, there is no problem in having an excess range (blank cells will not be counted).
Or you could use
=SUMPRODUCT(($B:$B>=TIME(10;0;0))*($B:$B<TIME(10;1;0)))
You can easily create a column with the start time for each interval, and another column using (a modification of) this formula to for the data count.
Then you would plot the two columns just created.
来源:https://stackoverflow.com/questions/30767231/how-to-calculate-results-and-plot-data-depending-on-results-of-a-specific-column