Skip to content

Remove the special case for empty dataframes. #6405

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

Merged
merged 1 commit into from
Mar 14, 2014

Conversation

filmor
Copy link
Contributor

@filmor filmor commented Feb 19, 2014

Fixes issue #6062.

@jreback
Copy link
Contributor

jreback commented Feb 19, 2014

can post a before and after of an empty frame (and also something with rows to make sure it hasn't changed)

@jreback jreback added this to the 0.14.0 milestone Feb 19, 2014
@filmor
Copy link
Contributor Author

filmor commented Mar 1, 2014

Before:

print(pd.DataFrame(columns=["asdf", "bsdf"]).to_html())

leads to

Index([], dtype='object') Empty DataFrame

With the patch you get:

asdf bsdf

A dataframe with values (pd.DataFrame(columns=["asdf", "bsdf"], data=[[1,2]])) leads to

asdf bsdf
0 1 2

in both cases.

@jreback
Copy link
Contributor

jreback commented Mar 1, 2014

@filmor no what I mean is actually put up a picture, like a png/jpeg of what it looks like in the browser. You can execute the code and save it that way.

@jreback
Copy link
Contributor

jreback commented Mar 9, 2014

can you add a release note (and a note in v0.14.0.txt for this), referencing the issue? (put in the API section)

looks good otherwise

@filmor
Copy link
Contributor Author

filmor commented Mar 11, 2014

Done.

@jreback
Copy link
Contributor

jreback commented Mar 11, 2014

@hayd @jorisvandenbossche look ok?

@jorisvandenbossche
Copy link
Member

Is this also how it will be displayed when printing a DataFrame in the notebook?

@filmor
Copy link
Contributor Author

filmor commented Mar 14, 2014

It is, yes. If this is not desired I'd vote for fixing this in IPython, not in df.to_html. It makes a lot of sense to have df.to_html be parseable again.

jreback added a commit that referenced this pull request Mar 14, 2014
Remove the special case for empty dataframes.
@jreback jreback merged commit dcbbc59 into pandas-dev:master Mar 14, 2014
@jreback
Copy link
Contributor

jreback commented Mar 14, 2014

thanks

@filmor filmor deleted the patch-1 branch March 14, 2014 20:26
@filmor filmor restored the patch-1 branch May 8, 2014 07:24
@filmor filmor deleted the patch-1 branch May 8, 2014 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO HTML read_html, to_html, Styler.apply, Styler.applymap Output-Formatting __repr__ of pandas objects, to_string
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants