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

DataFrame -> ColumnDataSource erases non-trivial index #111

Open
mrocklin opened this issue Mar 3, 2015 · 3 comments
Open

DataFrame -> ColumnDataSource erases non-trivial index #111

mrocklin opened this issue Mar 3, 2015 · 3 comments

Comments

@mrocklin
Copy link
Member

mrocklin commented Mar 3, 2015

By default we ignore the index. We should probably only do this if it's the trivial ordering 0, 1, 2, ... and treat it as data otherwise.

cc @brittainhard

@cpcloud cpcloud modified the milestone: 0.3.1 Mar 6, 2015
@cpcloud cpcloud modified the milestone: 0.3.1 Mar 19, 2015
@cpcloud cpcloud added this to the 0.4.0 milestone Jun 27, 2015
@femtotrader
Copy link

Support for datetime index (as primary key / unique) will be great.

Here is a sample.

You might install pandas_datareader

$ pip install pandas_datareader

Here is code:

import datetime
import pandas as pd
from pandas_datareader import data, wb

import blaze as bz
from blaze import odo

symbol = "AAPL"
df = data.DataReader(symbol, 'yahoo', datetime.datetime(2011, 1, 1), datetime.datetime(2015, 1, 1))
table_uri = 'dialect+driver://user:[email protected]:port/symbols::%s' % symbol
odo(df, table_uri)

@cpcloud cpcloud modified the milestones: 0.4.0, 0.3.5 Oct 5, 2015
@cpcloud cpcloud modified the milestones: 0.4.0, 0.4.1 Dec 4, 2015
@jdmcbr
Copy link
Contributor

jdmcbr commented Jan 19, 2016

I just ran into this issue when converting a dataframe to a table in a SQL database. Rather than checking for a non-trivial index, what about checking if the index is named or not?

@jdmcbr
Copy link
Contributor

jdmcbr commented Jan 30, 2016

My first thought was to set index=True in the appropriate places in odo.convert when there is a non-trivial index. However, I'm not seeing a way to have datashape.discover recognize an index. Calling reset_index in cases of a non-trivial index doesn't feel right. Any thoughts?

@kwmsmith kwmsmith modified the milestones: 0.4.1, 0.4.2, 0.5.0 Feb 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants