Skip to content

DataFrame.from_dict (orient broken?) #2496

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
hughesadam87 opened this issue Dec 12, 2012 · 5 comments
Closed

DataFrame.from_dict (orient broken?) #2496

hughesadam87 opened this issue Dec 12, 2012 · 5 comments
Labels
Milestone

Comments

@hughesadam87
Copy link

I tried creating using the from_dict() method to create a dataframe recently and noticed that orient='index' failed, even with trivial data.

a={'hi': [32, 3, 3], 'there': [3, 5, 3]}

df=DataFrame.from_dict(a)

df2=DataFrame.from_dict(a, orient='index')
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/EPD7.3/lib/python2.7/site-packages/pandas/core/frame.py", line 756, in from_dict
for col, v in s.iteritems():
AttributeError: 'list' object has no attribute 'iteritems'

It also failed with tuple values in the dictionary.

My current workaround is just to take the dataframe and perform a transpose, no big deal really.

@wesm
Copy link
Member

wesm commented Dec 13, 2012

will look into this before 0.10 final...

@hughesadam87
Copy link
Author

Thanks Wes
On Dec 12, 2012 10:18 PM, "Wes McKinney" [email protected] wrote:

will look into this before 0.10 final...


Reply to this email directly or view it on GitHub.

@ghost ghost assigned changhiskhan Dec 13, 2012
@hughesadam87
Copy link
Author

Just a heads up, this method is still working correctly for Panel.

@wesm
Copy link
Member

wesm commented Dec 14, 2012

Can you give a self-contained example illustrating the problem?

@changhiskhan
Copy link
Contributor

closed via 8d847fb

yarikoptic added a commit to neurodebian/pandas that referenced this issue Dec 20, 2012
* commit 'v0.10.0b1-65-g6cadd6c':
  BUG: workaround numpy issue in 1.6.2 on certain distros
  BUG: use "for" as keyword to test against
  ENH: option names must valid, non-keyword python identifiers
  TST: option names must valid, non-keyword python identifiers
  BUG: make sure pd.options style access triggers warnings and callbacks as needed
  ENH: provide attribute style access to options via pd.options
  REF: rename option key "print" to "display"
  BUG: use Series name attributes for colnames in concat with axis=1. close pandas-dev#2489
  ENH: add max_cols as keyword in DataFrame.info pandas-dev#2524
  BUG: allow users to set the max number of columns before per column info is hidden away pandas-dev#2524
  BUG: DataFrame.from_dict does not work with dict of sequence and orient=index pandas-dev#2496
  ENH: df.select uses bool(crit(x)) rather then crit(x)
  DOC: add FAQ section on monkey-patching
  BUG: diff should cast n to int pandas-dev#2523
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants