Skip to content
This repository has been archived by the owner on Dec 11, 2023. It is now read-only.

do not assume that np.array does the right thing #218

Merged
merged 4 commits into from
Jul 14, 2015

Conversation

sdvillal
Copy link
Contributor

Continuation of #217. The fix there only works for transposed arrays, but it still fails to fix errors with, for example, pandas dataframes:

import pandas as pd
import bcolz
df = pd.DataFrame(data={
    'a': np.arange(3),
    'b': np.arange(3)[::-1]
})
print(df)

   a  b
0  0  2
1  1  1
2  2  0

print(bcolz.carray(df))

[[0 1]
 [2 2]
 [1 0]]

This is the same example we had in #217, run with latest master (e260ca7) installed on latest anaconda. I'm working in a fix for this that will do the right thing (the first commit here is a step, but breaks other conversions).

we still need to check for contiguity and others; otherwise we would fail, for example, with some pandas dataframes
I wonder about interactions when, for example, passing a pandas dataframe and a dtype
Any relevant performance hit?
@sdvillal
Copy link
Contributor Author

This should now be ready to merge.

FrancescAlted added a commit that referenced this pull request Jul 14, 2015
More fixes when importing homogeneous pandas dataframes
@FrancescAlted FrancescAlted merged commit 4bbc307 into Blosc:master Jul 14, 2015
@FrancescAlted
Copy link
Member

Well done!

@esc
Copy link
Member

esc commented Jul 14, 2015

Yeah, looks pretty perfect.

@esc
Copy link
Member

esc commented Jul 14, 2015

@sdvillal do you have more stuff lined up? Just asking because I'd get on with the 0.10.0 release otherwise.

@sdvillal
Copy link
Contributor Author

@esc No, that was all for the moment.

@sdvillal
Copy link
Contributor Author

Actually I just thought, for continuous integration to run all tests, we should install pandas in travis/appveyor (I guess using something like miniconda instead of pip to be nice to these services and speed-up builds).

@FrancescAlted
Copy link
Member

👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants