Skip to content

Display of a datetime column/index with both second and sub-second resolution #10170

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jorisvandenbossche opened this issue May 19, 2015 · 1 comment · Fixed by #10171
Closed
Labels
Bug Output-Formatting __repr__ of pandas objects, to_string
Milestone

Comments

@jorisvandenbossche
Copy link
Member

Should a datetime column should use the same precision for all, padding with zeros, just like a float column does?

In [121]: df = pd.DataFrame({'datetime': pd.date_range('1/1/2000 09:00:00', freq="5ms",periods=10), 'float': np.arange(0,0.05,0.005)})

In [122]: df
Out[122]:
                    datetime  float
0        2000-01-01 09:00:00  0.000
1 2000-01-01 09:00:00.005000  0.005
2 2000-01-01 09:00:00.010000  0.010
3 2000-01-01 09:00:00.015000  0.015
4 2000-01-01 09:00:00.020000  0.020
5 2000-01-01 09:00:00.025000  0.025
6 2000-01-01 09:00:00.030000  0.030
7 2000-01-01 09:00:00.035000  0.035
8 2000-01-01 09:00:00.040000  0.040
9 2000-01-01 09:00:00.045000  0.045

so that the first row would show 2000-01-01 09:00:00.000000?

jreback added a commit to jreback/pandas that referenced this issue May 19, 2015
@jreback jreback added Bug Output-Formatting __repr__ of pandas objects, to_string labels May 19, 2015
@jreback jreback added this to the 0.17.0 milestone May 19, 2015
@jreback
Copy link
Contributor

jreback commented May 19, 2015

yes, see #10171

jreback added a commit to jreback/pandas that referenced this issue May 19, 2015
jreback added a commit to jreback/pandas that referenced this issue May 19, 2015
jreback added a commit to jreback/pandas that referenced this issue May 19, 2015
jreback added a commit to jreback/pandas that referenced this issue May 19, 2015
jreback added a commit to jreback/pandas that referenced this issue May 20, 2015
jreback added a commit to jreback/pandas that referenced this issue May 20, 2015
jorisvandenbossche added a commit that referenced this issue May 20, 2015
BUG: consistent datetime display format with < ms #10170
@jorisvandenbossche jorisvandenbossche modified the milestones: 0.17.0, 0.16.2 Jun 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Output-Formatting __repr__ of pandas objects, to_string
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants