How to plot timestamps within a row?

In summary, the user is trying to plot the values from a dataset that includes timestamp data within each row. They are using Python and have several hundred rows with data inside each. They are looking for a way to strip off the seconds and milliseconds and plot the data, possibly using a spreadsheet or awk.
  • #1
msn009
53
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: 341
Technology news on Phys.org
  • #2
are you not able to strip off the seconds and milliseconds? Seems like this should be trivially easy. What language are you using?
 
  • #3
phinds said:
What language are you using?
Several other threads by the OP show Python code.
 
  • #4
Read it into a spreadsheet. Most spreadsheets include many ways to read or display time. The spreadsheet can also make the plots for you.
 
  • #5
what he said (very small).jpg
 

Attachments

  • what he said (very small).jpg
    what he said (very small).jpg
    3.3 KB · Views: 313
  • Like
Likes jedishrfu
  • #6
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.
 
  • #7
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.
 
  • #8
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 anorlunda

Related to How to plot timestamps within a row?

1. How can I plot timestamps within a row?

To plot timestamps within a row, you can use a line graph or a scatter plot in a data visualization tool such as Excel or Tableau. You can also use programming languages like Python or R to create a custom plot.

2. What format should my timestamps be in for plotting?

The format of your timestamps will depend on the data visualization tool or programming language you are using. However, most tools and languages can handle timestamps in ISO 8601 format, which is YYYY-MM-DDTHH:MM:SS. You can also convert your timestamps into a numerical value, such as seconds or milliseconds since a specific starting point.

3. How can I customize the appearance of my timestamps on the plot?

In most data visualization tools, you can adjust the formatting of your timestamps by selecting the axis or data point and accessing the formatting options. In programming languages, you can use libraries or packages that offer customization options for timestamps, such as changing the date format or adding labels.

4. Can I plot multiple timestamps within the same row?

Yes, you can plot multiple timestamps within the same row by using different colors or markers for each timestamp. This can help visualize patterns and relationships between the timestamps.

5. Is it possible to plot timestamps for a large dataset?

Yes, it is possible to plot timestamps for a large dataset. Most data visualization tools and programming languages have the capability to handle large datasets. However, it may take longer to process and render the plot depending on the size of the dataset.

Similar threads

  • Programming and Computer Science
Replies
9
Views
1K
  • Programming and Computer Science
Replies
3
Views
1K
  • Programming and Computer Science
Replies
7
Views
538
  • Programming and Computer Science
Replies
3
Views
1K
  • Programming and Computer Science
Replies
2
Views
2K
  • Programming and Computer Science
Replies
2
Views
1K
  • Programming and Computer Science
Replies
14
Views
4K
  • Programming and Computer Science
Replies
1
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
596
  • Programming and Computer Science
Replies
5
Views
1K
Back
Top