Skip to content

ENH: Number formatting support for excel styles #22015

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 2 commits into from
Jul 24, 2018

Conversation

marknsikora
Copy link
Contributor

@marknsikora marknsikora commented Jul 21, 2018

Add number formatting support to the excel styles using a fake css entry.

number-format: 0%;

Added new tests, updated docs, and manually verified outputs using both excel output engines that support styling.

@marknsikora marknsikora changed the title EHN: Number formatting support for excel styles ENH: Number formatting support for excel styles Jul 21, 2018
@marknsikora marknsikora force-pushed the excel-number-format branch from a1e0788 to b148a28 Compare July 21, 2018 21:15
@codecov
Copy link

codecov bot commented Jul 21, 2018

Codecov Report

Merging #22015 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #22015      +/-   ##
==========================================
+ Coverage      92%      92%   +<.01%     
==========================================
  Files         168      168              
  Lines       50603    50605       +2     
==========================================
+ Hits        46555    46557       +2     
  Misses       4048     4048
Flag Coverage Δ
#multiple 90.4% <100%> (ø) ⬆️
#single 42.19% <50%> (ø) ⬆️
Impacted Files Coverage Δ
pandas/io/formats/excel.py 97.39% <100%> (+0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b975455...4c28407. Read the comment docs.

@WillAyd
Copy link
Member

WillAyd commented Jul 22, 2018

Haven't reviewed code in detail yet but does this reference an existing issue? If not can you open and add reference in whatsnew?

@WillAyd WillAyd added IO Excel read_excel, to_excel Code Style Code style, linting, code_checks labels Jul 22, 2018
@marknsikora marknsikora force-pushed the excel-number-format branch 2 times, most recently from b3d7650 to 901142c Compare July 23, 2018 16:11
@marknsikora
Copy link
Contributor Author

Done

@marknsikora marknsikora force-pushed the excel-number-format branch from 901142c to b06cff6 Compare July 23, 2018 19:32
Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @gfyoung for input.

May just be my lack of familiarity with styling but what is the preferred way of using this from an end user perspective? .apply with a UDF? Might be worth adding an example to the style notebook to illustrate

@gfyoung
Copy link
Member

gfyoung commented Jul 24, 2018

@marknsikora : This looks good at the moment. Could you add whatsnew entry for 0.24.0 ?

@gfyoung gfyoung requested a review from TomAugspurger July 24, 2018 04:21
@TomAugspurger TomAugspurger merged commit 3e48393 into pandas-dev:master Jul 24, 2018
@TomAugspurger
Copy link
Contributor

Thanks @marknsikora .

@marknsikora marknsikora deleted the excel-number-format branch July 24, 2018 16:04
Sup3rGeo pushed a commit to Sup3rGeo/pandas that referenced this pull request Oct 1, 2018
* ENH: Number formatting support for excel styles
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Style Code style, linting, code_checks Enhancement IO Excel read_excel, to_excel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No way to control display format when exporting to excel
4 participants