Skip to content
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

Smarter formatting of timedelta and datetime columns #5701

Merged
merged 1 commit into from Jan 15, 2014

Conversation

cancan101
Copy link
Contributor

Closes #3401
Closes #5708
Closes #5912

@cancan101
Copy link
Contributor Author

@jreback What do you think shouold be done about the __unicode__ method (https://github.com/pydata/pandas/blob/master/pandas/tseries/index.py#L529) ? Should that also omit the time string if the time is not set? Should it check each element in the array to determine when to do this? Or only the first and last?

@jreback
Copy link
Contributor

jreback commented Dec 16, 2013

@cancan101 for DataTimeIndex, I think you should leave it unless:

you determine for the entire series if their are time elements or not (using the quick test and it doesn't affect perf) - this should actually become a method of the DateTimeIndex (as a cached property)

then you could change unicode

@cancan101
Copy link
Contributor Author

@jreback I can see what can be done about unicode. Either way, cleaning up that method seems less important.

@jreback
Copy link
Contributor

jreback commented Dec 16, 2013

yep....no biggie either way

if isnull(x):
return 'NaT'
return nat_rep

stamp = lib.Timestamp(x, tz=tz)
return stamp._repr_base
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have to make sure this works for having tzinfo set. For example:

In [11]: pd.to_datetime([datetime(2013,1,1,tzinfo=pytz.utc)]).format()
Out[11]: [u'2013-01-01 00:00:00+00:00']

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NaT should be returned if its null

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean here? I needed to allow passing in the nat_rep for: https://github.com/pydata/pandas/blob/master/pandas/tseries/index.py#L630

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my bad....u r right

@cancan101
Copy link
Contributor Author

Should just be a matter of using code similar to https://github.com/pydata/pandas/pull/5701/files#diff-23878beaf55672cdc92c119f79fe492aR1797 and making sure to cache the call to _is_dates_only

@jreback
Copy link
Contributor

jreback commented Dec 16, 2013

yep....just try not to repeat the code

@jreback
Copy link
Contributor

jreback commented Jan 3, 2014

pls rebase and squash a bit

@jreback
Copy link
Contributor

jreback commented Jan 3, 2014

also pls add a release notes (and in this case a whatsnew entry - in v0.13.1.txt, giving a short demo)

@cancan101
Copy link
Contributor Author

@jreback Done, let me know what you think.

limit precision based on the values in the array (:issue:`3401`)

Previously output might look like:
.. ipython:: python
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first one needs to be a code-block, and make the second one actual code (e.g. create a dataframe that has those values and print it). Need to skip a line after the directive as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean the first one needs to be a code-block?

Something like this:

  .. code-block:: python

        age                 today               diff
      0 2001-01-01 00:00:00 2013-04-19 00:00:00 4491 days, 00:00:00
      1 2004-06-01 00:00:00 2013-04-19 00:00:00 3244 days, 00:00:00

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I leave off the example output (ie will the compilation of the release notes actually run the code)?

For example, is this enough:

   .. ipython:: python

      df = DataFrame([ Timestamp('20010101'),
                       Timestamp('20040601') ], columns=['age'])
      df['today'] = Timestamp('20130419')
      df['diff'] = df['today']-df['age']
      df

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

build the docs and see (and will who why u need a code block)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am I doing something wrong here with make doc:

  File "/home/alex/git/pandas/doc/source/_templates/autosummary/class.rst", line 1, in top-level template code
    {% extends "!autosummary/class.rst" %}
  File "/home/alex/git/pandas/doc/source/_templates/autosummary/class.rst", line 1, in top-level template code
    {% extends "!autosummary/class.rst" %}
  File "/usr/local/lib/python2.7/dist-packages/jinja2/utils.py", line 339, in get
    return self[key]
  File "/usr/local/lib/python2.7/dist-packages/jinja2/utils.py", line 389, in __getitem__
    if self._queue[-1] != key:
RuntimeError: maximum recursion depth exceeded in cmp
> /usr/local/lib/python2.7/dist-packages/jinja2/utils.py(389)__getitem__()
-> if self._queue[-1] != key:
(Pdb) 

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which version of Sphinx do you have?
I noticed some problems when using the newest version (v1.2, still had to file an issue about it), and if I remember well, it was a similar error message.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have 1.2 installed.

@cancan101
Copy link
Contributor Author

@jreback Anything else to get this merged?

@jreback
Copy link
Contributor

jreback commented Jan 9, 2014

@jorisvandenbossche @jtratner @y-p any comments?

@jorisvandenbossche
Copy link
Member

good for me

@jreback
Copy link
Contributor

jreback commented Jan 11, 2014

pls rebase...can you run the vbenchs just to confirm nothing reallly changes with this? (don't think it will but just to check)

@cancan101
Copy link
Contributor Author

These stick out over a few runs of vbench:

frame_to_csv_mixed                           | 219.4360 | 208.9397 |   1.0502 |
packers_write_csv                            | 779.2506 | 442.6716 |   1.7603 |

@jreback
Copy link
Contributor

jreback commented Jan 12, 2014

Assuming you are benching this against master; the frame_to_csv_mixed has not changed much from master (e.g. the 1.0502 ratio), so it does NOT stick out and doesn't matter. The fact that it takes 200ms is irrelevant.

However, the other test packers_write_csv DOES look like a problem; its writing a datetime index. That is not a good increase. Pls investigate what is taking the extra time, e.g. use %prun and see if it can be remedied.

@cancan101
Copy link
Contributor Author

What is the easiest way to run one of the vbench Benchmarks individually in IPython so that I can benchmark?

@jreback
Copy link
Contributor

jreback commented Jan 12, 2014

just copy the code and run it
it's 2 lines

@cancan101
Copy link
Contributor Author

This function is expensive:

def _format_datetime64(x, tz=None, nat_rep='NaT'):
    if isnull(x):
        return nat_rep

    stamp = lib.Timestamp(x, tz=tz)
    if stamp.tzinfo is not None:
        return str(stamp)
    return stamp._repr_base

@cancan101
Copy link
Contributor Author

Changing the isnull to checknull gives a nice speed boost.

@cancan101
Copy link
Contributor Author

@jreback (still spelling my name wrong...)
It actually is not the nan check. I tried removing it completely and it does not show a large reduction in time. The evaluation of the _repr_base is quite expensive.

Also I uncovered #5912 in my tinkering.

@cancan101
Copy link
Contributor Author

For example If I strip it down to:

def _format_datetime64(x, tz=None, nat_rep='NaT'):
#     if x is None or lib.checknull(x):
#         return nat_rep
# 
#     if tz is not None or not isinstance(x, lib.Timestamp):
#         x = lib.Timestamp(x, tz=tz)

    if x.tzinfo is not None:
        return str(x)
    else:
        return x._repr_base

the time per 50,000 calls goes from 0.310s to 0.280s

@cancan101
Copy link
Contributor Author

Whereas this:

def _format_datetime64(x, tz=None, nat_rep='NaT'):
    if x is None or lib.checknull(x):
        return nat_rep

    if tz is not None or not isinstance(x, lib.Timestamp):
        x = lib.Timestamp(x, tz=tz)

    if x.tzinfo is not None:
        return str(x)
    else:
        return str(x)
#         return x._repr_base

takes 0.119s

@cancan101
Copy link
Contributor Author

@jreback Because of #5912, the current code is actually broken:

        # tz formatter or time formatter
         zero_time = time(0, 0)
         if date_format is None:
             for d in data:
                 if d.time() != zero_time or d.tzinfo is not None:
                     return [u('%s') % x for x in data]

leads to:

In [48]: [unicode('%s') % x for x in [pd.Timestamp(200)]]
Out[48]: [u'1970-01-01 00:00:00']

@cancan101
Copy link
Contributor Author

Even for formatting jsut the date, using the native format appears superior:

In [49]: ts = pd.Timestamp("2013-1-1")

In [60]: %timeit '%d-%.2d-%.2d' % (ts.year, ts.month, ts.day)
100000 loops, best of 3: 2.3 µs per loop

In [56]: %timeit ts.strftime("%Y-%m-%d")
100000 loops, best of 3: 2.08 µs per loop

@cancan101
Copy link
Contributor Author

Performance looks good with the newest change (all results > 3%):

groupby_multi_size                           |  23.0029 |  22.2677 |   1.0330 |
datetime_index_intersection                  |   0.2843 |   0.2750 |   1.0338 |
groupby_last                                 |   3.9919 |   3.8571 |   1.0350 |
frame_mult_no_ne                             |   5.3106 |   5.1310 |   1.0350 |
frame_multi_and_no_ne                        |  85.9957 |  82.9343 |   1.0369 |
frame_iteritems_cached                       |   0.4876 |   0.4700 |   1.0375 |
packers_write_pack                           |   3.4560 |   3.3247 |   1.0395 |
timeseries_to_datetime_YYYYMMDD              |   7.8693 |   7.5637 |   1.0404 |
dti_reset_index_tz                           |   9.1580 |   8.7987 |   1.0408 |
frame_assign_timeseries_index                |   0.6383 |   0.6119 |   1.0431 |
frame_ctor_list_of_dict                      |  67.9533 |  65.0856 |   1.0441 |
frame_get_numeric_data                       |   0.1024 |   0.0980 |   1.0446 |
plot_timeseries_period                       |  67.0340 |  64.1300 |   1.0453 |
eval_frame_mult_one_thread                   |  11.6833 |  11.1721 |   1.0458 |
series_align_left_monotonic                  |  11.8790 |  11.3533 |   1.0463 |
replace_fillna                               |   1.6336 |   1.5583 |   1.0483 |
reindex_fillna_backfill                      |   0.4443 |   0.4230 |   1.0505 |
packers_read_pickle                          |   0.6233 |   0.5923 |   1.0523 |
frame_drop_duplicates_na                     |  14.5866 |  13.8346 |   1.0544 |
frame_constructor_ndarray                    |   0.0503 |   0.0477 |   1.0550 |
stat_ops_frame_mean_int_axis_1               |   0.7436 |   0.7047 |   1.0553 |
indexing_dataframe_boolean_rows              |   0.3553 |   0.3363 |   1.0565 |
replace_replacena                            |   1.1587 |   1.0910 |   1.0621 |
frame_multi_and_st                           |  37.9917 |  35.7176 |   1.0637 |
frame_ctor_nested_dict_int64                 |  83.4666 |  78.0357 |   1.0696 |
frame_html_repr_trunc_si                     |  31.3597 |  29.2840 |   1.0709 |
timestamp_ops_diff2                          |  18.5770 |  17.2790 |   1.0751 |
series_timestamp_compare                     |   2.2450 |   2.0747 |   1.0821 |
series_constructor_ndarray                   |   0.0160 |   0.0146 |   1.0924 |
frame_to_csv_mixed                           | 226.2426 | 206.5704 |   1.0952 |
lib_fast_zip                                 |   8.4523 |   7.7160 |   1.0954 |
frame_mult_st                                |   5.8163 |   5.2950 |   1.0985 |
series_ctor_from_dict                        |   2.4934 |   2.2697 |   1.0986 |
stat_ops_frame_mean_int_axis_0               |   0.6413 |   0.5833 |   1.0995 |
frame_from_series                            |   0.1020 |   0.0927 |   1.1003 |
frame_mult                                   |   6.0443 |   5.4270 |   1.1138 |
reindex_fillna_pad                           |   0.4726 |   0.4203 |   1.1244 |
frame_add                                    |   6.1897 |   5.4307 |   1.1398 |
frame_boolean_row_select                     |   0.3163 |   0.2677 |   1.1817 |
frame_dropna_axis0_all                       |  66.0930 |  55.6227 |   1.1882 |

@jreback
Copy link
Contributor

jreback commented Jan 13, 2014

can you show a perf check (just > 3%), but show all output otherwise (e.g. the commits which are refed)

@cancan101
Copy link
Contributor Author

read_csv_vb                                  |  19.6720 |  19.0364 |   1.0334 |
frame_drop_duplicates_na                     |  13.9967 |  13.5247 |   1.0349 |
frame_drop_duplicates                        |  13.9990 |  13.5140 |   1.0359 |
timeseries_to_datetime_YYYYMMDD              |   7.8971 |   7.5977 |   1.0394 |
frame_iteritems_cached                       |   0.4943 |   0.4753 |   1.0400 |
reindex_fillna_pad                           |   0.4340 |   0.4147 |   1.0466 |
groupby_frame_cython_many_columns            |   3.2623 |   3.1164 |   1.0468 |
frame_loc_dups                               |   0.7423 |   0.7057 |   1.0518 |
lib_fast_zip_fillna                          |  11.2507 |  10.6874 |   1.0527 |
index_datetime_intersection                  |   8.7774 |   8.2906 |   1.0587 |
index_datetime_union                         |   8.8987 |   8.3983 |   1.0596 |
frame_to_csv_mixed                           | 224.2047 | 209.4917 |   1.0702 |
timeseries_to_datetime_iso8601               |   4.1014 |   3.7773 |   1.0858 |
read_csv_comment2                            |  26.4043 |  23.7966 |   1.1096 |
-------------------------------------------------------------------------------
Test name                                    | head[ms] | base[ms] |  ratio   |
-------------------------------------------------------------------------------

Ratio < 1.0 means the target commit is faster then the baseline.
Seed used: 1234

Target [2ef79c1] : - added unit tests for string represetnation for Timestamp
Base   [f4fc029] : Merge pull request #5910 from andrewkittredge/master

docstring grammar.

@cancan101
Copy link
Contributor Author

and again:

indexing_dataframe_boolean                   |   9.4174 |   9.1384 |   1.0305 |
groupby_frame_cython_many_columns            |   3.1878 |   3.0884 |   1.0322 |
indexing_dataframe_boolean_no_ne             |  43.8906 |  42.5130 |   1.0324 |
reindex_fillna_pad_float32                   |   0.3678 |   0.3562 |   1.0325 |
series_align_irregular_string                |  60.5652 |  58.6400 |   1.0328 |
replace_replacena                            |   1.1068 |   1.0716 |   1.0328 |
frame_dropna_axis0_all                       |  57.3918 |  55.4894 |   1.0343 |
frame_mult_no_ne                             |   5.2668 |   5.0780 |   1.0372 |
frame_fancy_lookup_all                       |  16.5482 |  15.9496 |   1.0375 |
series_timestamp_compare                     |   2.1666 |   2.0858 |   1.0387 |
merge_2intkey_sort                           |  38.7962 |  37.2868 |   1.0405 |
timeseries_to_datetime_iso8601               |   3.9238 |   3.7662 |   1.0418 |
lib_fast_zip_fillna                          |  11.1918 |  10.7384 |   1.0422 |
frame_drop_duplicates_na                     |  14.3016 |  13.6798 |   1.0455 |
frame_drop_duplicates                        |  14.2042 |  13.4510 |   1.0560 |
frame_to_csv_mixed                           | 218.6362 | 206.7750 |   1.0574 |
frame_getitem_single_column2                 |  19.2658 |  18.0688 |   1.0662 |
query_datetime_series                        |  23.2566 |  21.8094 |   1.0664 |
packers_write_pack                           |   5.3828 |   5.0006 |   1.0764 |
frame_iteritems_cached                       |   0.5000 |   0.4636 |   1.0785 |
read_csv_comment2                            |  26.9246 |  24.7684 |   1.0871 |
packers_read_pickle                          |   0.6400 |   0.5852 |   1.0937 |
packers_write_pickle                         |   5.0150 |   4.4114 |   1.1368 |
-------------------------------------------------------------------------------
Test name                                    | head[ms] | base[ms] |  ratio   |
-------------------------------------------------------------------------------

Ratio < 1.0 means the target commit is faster then the baseline.
Seed used: 1234

Target [2ef79c1] : - added unit tests for string represetnation for Timestamp
Base   [f4fc029] : Merge pull request #5910 from andrewkittredge/master

docstring grammar.

@cancan101
Copy link
Contributor Author

@jreback Let me know what you think about the newest code and results.

def _format_native_types(self, na_rep=u('NaT'),
date_format=None, **kwargs):
data = self._get_object_index()
from pandas.core.format import Datetime64Formatter
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you move to module level imports? (or does it cause a problem)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are circular import problems from that I recall.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

np them

@jreback
Copy link
Contributor

jreback commented Jan 14, 2014

just couple of minor comments. pls squash any commits together if you can/make sense, rebase and can merge

@cancan101
Copy link
Contributor Author

@jreback done

@jreback
Copy link
Contributor

jreback commented Jan 15, 2014

one more time.....(I just merged something..)

For Datetime this means that only the date is shown when for all values
there is no timezone and time is midnight and for Timedelta this means
that the deltas are all whole days (GH3401). str(NaT) fixed to be "NaT"
(GH5708).
@cancan101
Copy link
Contributor Author

@jreback done again

jreback added a commit that referenced this pull request Jan 15, 2014
Smarter formatting of timedelta and datetime columns
@jreback jreback merged commit 7d0c26e into pandas-dev:master Jan 15, 2014
@jreback
Copy link
Contributor

jreback commented Jan 15, 2014

thanks! nice PR! keep em coming

@jreback
Copy link
Contributor

jreback commented Jan 15, 2014

side issue - I think this was there before....the 0's in timedeltas when displaying long format should be full-rank

In [7]: DataFrame(dict(A = date_range('20130101',periods=10), B = date_range('20130101',periods=10,freq='s'),C=pd.to_timedelta(np.arange(10),unit='ms'),D=pd.to_timedelta(np.arange(10),unit='D')))
Out[7]: 
           A                   B               C      D
0 2013-01-01 2013-01-01 00:00:00        00:00:00 0 days
1 2013-01-02 2013-01-01 00:00:01 00:00:00.001000 1 days
2 2013-01-03 2013-01-01 00:00:02 00:00:00.002000 2 days
3 2013-01-04 2013-01-01 00:00:03 00:00:00.003000 3 days
4 2013-01-05 2013-01-01 00:00:04 00:00:00.004000 4 days
5 2013-01-06 2013-01-01 00:00:05 00:00:00.005000 5 days
6 2013-01-07 2013-01-01 00:00:06 00:00:00.006000 6 days
7 2013-01-08 2013-01-01 00:00:07 00:00:00.007000 7 days
8 2013-01-09 2013-01-01 00:00:08 00:00:00.008000 8 days
9 2013-01-10 2013-01-01 00:00:09 00:00:00.009000 9 days

[10 rows x 4 columns]

@cancan101
Copy link
Contributor Author

@jreback Yes, I believe that issues was very much there before. That one is a little tougher to deal with and will require further generalizing the format from just long/short.

@jreback
Copy link
Contributor

jreback commented Jan 15, 2014

okay be create an issue for it and get 2 it when possible

@TomAugspurger
Copy link
Contributor

I think that this commit broke some tests: cancan101@cfb9c98

(pandas-dev) ~/E/p/l/p/s/p/p/tests ((cfb9c98...)) nosetests test_index
...........................EE.E...................................................................................................................................................
======================================================================
ERROR: test_format (test_index.TestIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/admin/Envs/pandas-dev/lib/python2.7/site-packages/pandas/pandas/tests/test_index.py", line 488, in test_format
    self._check_method_works(Index.format)
  File "/Users/admin/Envs/pandas-dev/lib/python2.7/site-packages/pandas/pandas/tests/test_index.py", line 540, in _check_method_works
    method(self.dateIndex)
  File "/Users/admin/Envs/pandas-dev/lib/python2.7/site-packages/pandas/pandas/core/index.py", line 703, in format
    return self._format_with_header(header, **kwargs)
  File "/Users/admin/Envs/pandas-dev/lib/python2.7/site-packages/pandas/pandas/tseries/index.py", line 639, in _format_with_header
    return header + self._format_native_types(**kwargs)
  File "/Users/admin/Envs/pandas-dev/lib/python2.7/site-packages/pandas/pandas/tseries/index.py", line 648, in _format_native_types
    justify='all').get_result()
  File "/Users/admin/Envs/pandas-dev/lib/python2.7/site-packages/pandas/pandas/core/format.py", line 1635, in get_result
    fmt_values = self._format_strings()
  File "/Users/admin/Envs/pandas-dev/lib/python2.7/site-packages/pandas/pandas/core/format.py", line 1760, in _format_strings
    date_format=self.date_format)
  File "/Users/admin/Envs/pandas-dev/lib/python2.7/site-packages/pandas/pandas/core/format.py", line 1813, in _get_format_datetime64_from_values
    is_dates_only = _is_dates_only(values)
  File "/Users/admin/Envs/pandas-dev/lib/python2.7/site-packages/pandas/pandas/core/format.py", line 1795, in _is_dates_only
    if d is not None and not lib.checknull(d) and d._has_time_component():
AttributeError: 'Timestamp' object has no attribute '_has_time_component'

======================================================================
ERROR: test_format_datetime_with_time (test_index.TestIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/admin/Envs/pandas-dev/lib/python2.7/site-packages/pandas/pandas/tests/test_index.py", line 520, in test_format_datetime_with_time
    result = t.format()
  File "/Users/admin/Envs/pandas-dev/lib/python2.7/site-packages/pandas/pandas/core/index.py", line 703, in format
    return self._format_with_header(header, **kwargs)
  File "/Users/admin/Envs/pandas-dev/lib/python2.7/site-packages/pandas/pandas/tseries/index.py", line 639, in _format_with_header
    return header + self._format_native_types(**kwargs)
  File "/Users/admin/Envs/pandas-dev/lib/python2.7/site-packages/pandas/pandas/tseries/index.py", line 648, in _format_native_types
    justify='all').get_result()
  File "/Users/admin/Envs/pandas-dev/lib/python2.7/site-packages/pandas/pandas/core/format.py", line 1635, in get_result
    fmt_values = self._format_strings()
  File "/Users/admin/Envs/pandas-dev/lib/python2.7/site-packages/pandas/pandas/core/format.py", line 1760, in _format_strings
    date_format=self.date_format)
  File "/Users/admin/Envs/pandas-dev/lib/python2.7/site-packages/pandas/pandas/core/format.py", line 1813, in _get_format_datetime64_from_values
    is_dates_only = _is_dates_only(values)
  File "/Users/admin/Envs/pandas-dev/lib/python2.7/site-packages/pandas/pandas/core/format.py", line 1795, in _is_dates_only
    if d is not None and not lib.checknull(d) and d._has_time_component():
AttributeError: 'Timestamp' object has no attribute '_has_time_component'

======================================================================
ERROR: test_format_with_name_time_info (test_index.TestIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/admin/Envs/pandas-dev/lib/python2.7/site-packages/pandas/pandas/tests/test_index.py", line 514, in test_format_with_name_time_info
    formatted = dates.format(name=True)
  File "/Users/admin/Envs/pandas-dev/lib/python2.7/site-packages/pandas/pandas/core/index.py", line 703, in format
    return self._format_with_header(header, **kwargs)
  File "/Users/admin/Envs/pandas-dev/lib/python2.7/site-packages/pandas/pandas/tseries/index.py", line 639, in _format_with_header
    return header + self._format_native_types(**kwargs)
  File "/Users/admin/Envs/pandas-dev/lib/python2.7/site-packages/pandas/pandas/tseries/index.py", line 648, in _format_native_types
    justify='all').get_result()
  File "/Users/admin/Envs/pandas-dev/lib/python2.7/site-packages/pandas/pandas/core/format.py", line 1635, in get_result
    fmt_values = self._format_strings()
  File "/Users/admin/Envs/pandas-dev/lib/python2.7/site-packages/pandas/pandas/core/format.py", line 1760, in _format_strings
    date_format=self.date_format)
  File "/Users/admin/Envs/pandas-dev/lib/python2.7/site-packages/pandas/pandas/core/format.py", line 1813, in _get_format_datetime64_from_values
    is_dates_only = _is_dates_only(values)
  File "/Users/admin/Envs/pandas-dev/lib/python2.7/site-packages/pandas/pandas/core/format.py", line 1795, in _is_dates_only
    if d is not None and not lib.checknull(d) and d._has_time_component():
AttributeError: 'Timestamp' object has no attribute '_has_time_component'

----------------------------------------------------------------------
Ran 178 tests in 1.166s

FAILED (errors=3)

I'm on a Mac if that matters. I can do a bit of digging.

@jreback
Copy link
Contributor

jreback commented Jan 15, 2014

@TomAugspurger you resetup? (this has library changes that need to be recompiled)

@TomAugspurger
Copy link
Contributor

Ahh that was it. I was doing a python setup.py install, but I guess that wasn't enough. Thanks.

@jreback
Copy link
Contributor

jreback commented Jan 15, 2014

gr8!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants