Why converting time to index in pandas dataframe?

  • #1
fog37
1,549
107
Hello,
When dealing with a dataframe with two columns, X and T where T is time, the time column is often converted to be the index of the dataframe itself (which by default is 0,1,2,3,...). What is the advantage of doing that? I know how to implement that but I am not sure what the main benefit is...

Thank you!
 
Computer science news on Phys.org
  • #2
fog37 said:
Hello,
When dealing with a dataframe with two columns, X and T where T is time, the time column is often converted to be the index of the dataframe itself (which by default is 0,1,2,3,...). What is the advantage of doing that? I know how to implement that but I am not sure what the main benefit is...

Thank you!
IF the time step is a constant, ##\delta t##, then the times can be converted into a time step index. That is the way a time series is usually represented. In the usual time series analysis, the magnitude of the time step is not used in the analysis, as long as it is constant.
 
Last edited:
  • Like
Likes fog37

Similar threads

  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
381
Replies
3
Views
724
  • Introductory Physics Homework Help
Replies
24
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
10
Views
739
  • Special and General Relativity
Replies
1
Views
621
  • Computing and Technology
Replies
14
Views
3K
  • Linear and Abstract Algebra
Replies
2
Views
870
  • Special and General Relativity
5
Replies
146
Views
5K
  • Introductory Physics Homework Help
Replies
5
Views
951
  • Programming and Computer Science
Replies
32
Views
2K
Back
Top