How to plot timestamps within a row?

  • Thread starter Thread starter msn009
  • Start date Start date
  • Tags Tags
    Plot Python Row
Click For Summary

Discussion Overview

The discussion revolves around how to plot timestamp data that is embedded within each row of a dataset. Participants explore various methods and programming languages to achieve this, focusing on practical approaches for visualizing the data distribution.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant seeks advice on plotting timestamp data that is formatted within rows of a dataset.
  • Another participant suggests stripping off seconds and milliseconds as a potential simplification, questioning the complexity of the task.
  • There is a request for clarification on the programming language being used, with indications that Python is involved based on previous threads.
  • A suggestion is made to use a spreadsheet to read and visualize the timestamp data, highlighting the capabilities of spreadsheets for plotting.
  • The original poster reiterates the challenge of having multiple timestamps within each row and expresses a preference for using Python to read the file and generate plots.
  • One participant proposes using awk as a straightforward solution for processing the data on Linux, providing a command example to extract specific columns for plotting.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the best method to plot the timestamps, with multiple suggestions and approaches being discussed. The discussion remains unresolved regarding the most effective solution.

Contextual Notes

There are limitations regarding the assumptions about the dataset structure and the specific requirements for plotting. The discussion does not clarify the format of the timestamps or the desired output of the plots.

msn009
Messages
53
Reaction score
6
i have a dataset that has the timestamp data within each row and I am trying to plot the values to see the distribution but have no idea how to do it if the data is presented this way as attached. any ideas? thanks
 

Attachments

  • pic5.png
    pic5.png
    7.3 KB · Views: 410
Technology news on Phys.org
are you not able to strip off the seconds and milliseconds? Seems like this should be trivially easy. What language are you using?
 
phinds said:
What language are you using?
Several other threads by the OP show Python code.
 
Read it into a spreadsheet. Most spreadsheets include many ways to read or display time. The spreadsheet can also make the plots for you.
 
what he said (very small).jpg
 

Attachments

  • what he said (very small).jpg
    what he said (very small).jpg
    3.3 KB · Views: 414
  • Like
Likes   Reactions: jedishrfu
sorry, i thought the tag would show python and yes it is in python. but these timestamps are within the row itself and i have several hundred rows with this data inside each. i thought of doing it in python so that i can read the file and plot a chart for each.
 
msn009 said:
sorry, i thought the tag would show python and yes it is in python. but these timestamps are within the row itself and i have several hundred rows with this data inside each. i thought of doing it in python so that i can read the file and plot a chart for each.
Then I ask again, can you not just strip off the seconds and milliseconds? I don't know Python but in C and VB.NET this is easy and doing your own plot would be reasonably easy.
 
awk would be the easiest thing to use if you're on linux.
Code:
awk '{print $2}' input filename_goes_here >outputfilename_goes_here
Awk processes each line and prints out only the second column and from there you can plot the data
 
  • Like
Likes   Reactions: anorlunda

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 7 ·
Replies
7
Views
5K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K
Replies
2
Views
2K
  • · Replies 11 ·
Replies
11
Views
1K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 14 ·
Replies
14
Views
2K