A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pandas-dev/pandas/issues/9456 below:

need better inference for path in Series construction · Issue #9456 · pandas-dev/pandas · GitHub

This hits a path in Series.__init__ which I think needs some better inference

https://github.com/pydata/pandas/blob/master/pandas/core/series.py#L178

In [1]: d = {numpy.datetime64('2015-01-07T02:00:00.000000000+0200'): 42544017.198965244,
   ...:      numpy.datetime64('2015-01-08T02:00:00.000000000+0200'): 40512335.181958228,
   ...:      numpy.datetime64('2015-01-09T02:00:00.000000000+0200'): 39712952.781494237,
   ...:      numpy.datetime64('2015-01-12T02:00:00.000000000+0200'): 39002721.453793451}

In [2]: Series(d)
Out[2]: 
2015-01-07   NaN
2015-01-08   NaN
2015-01-09   NaN
2015-01-12   NaN
dtype: float64

In [3]: Series(d.values(),d.keys())
Out[3]: 
2015-01-07    42544017.198965
2015-01-08    40512335.181958
2015-01-09    39712952.781494
2015-01-12    39002721.453793
dtype: float64

The problem is the index is already converted at this point and its not easy to get the keys/values out (except to do so explicity which is better IMHO).

Need a review of what currently hits this path (can simply put a halt in here and see what tests hit this). Then figure out a better method.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4