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

Resizing columns with fractions, the numbers are shifted left not right. Removing the significant numbers first, instead of the lowest dicimals #228

Closed
war-live opened this issue Jul 11, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@war-live
Copy link

Type: Bug

Behaviour

Expected vs. Actual

When resizing a column of a floating point, the number is trimmed from the left removing the most significant figures first in the column display while insignificant decimals are kept visible. This only allows the columns to be reduced to the full floating point size, where most often anything beyond the 4 significant figure is superfluous.
The display should move the floating point to the right, removing the smallest decimals first instead of the largest significant figure.
An adjustable global significant figure view would help.

Steps to reproduce:

  1. pandas 3.10

import numpy as np
import pandas as pd
rawdata = [{'column1' : 15,'column2' : 25/3,'col3' : 200np.pi,'col4' : 523,'column5' : 2/3,'column6':1/(np.pi10),'column7':56}]
df = pd.DataFrame(data=rawdata)

resize columns 2,3,5,6

Diagnostic data

  • Jupyter extension version: 2024.6.0
  • Python extension version: 2024.10.0
  • .NET Install Tool for Extension Authors extension version: 2.0.8
  • Python package dependencies:
{
  "installed": {
    "pandas": "1.5.2"
  },
  "required": {
    "pandas": "0.25.2"
  },
  "unsatisfied": []
}
  • Entrypoint: JupyterDataViewer
  • Active mode: dataViewer

Extension version: 1.4.1
VS Code version: Code 1.91.0 (ea1445cc7016315d0f5728f8e8b12a45dc0a7286, 2024-07-01T18:52:22.949Z)
OS version: Windows_NT x64 10.0.22631
Modes:

System Info
Item Value
CPUs 13th Gen Intel(R) Core(TM) i7-13700K (24 x 3418)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) undefined
Memory (System) 31.75GB (20.60GB free)
Process Argv --crash-reporter-id 25e1c21b-88c4-484b-973e-2ab8a5be0e72
Screen Reader no
VM 0%
A/B Experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492cf:30256860
vscoreces:30445986
vscod805cf:30301675
binariesv615:30325510
vsaa593cf:30376535
py29gd2263:31024239
vscaat:30438848
c4g48928:30535728
azure-dev_surveyone:30548225
2i9eh265:30646982
962ge761:30959799
9b8hh234:30694863
pythongtdpath:30769146
welcomedialog:30910333
pythonnoceb:30805159
asynctok:30898717
pythonregdiag2:30936856
pythonmypyd1:30879173
h48ei257:31000450
pythontbext0:30879054
accentitlementsc:30995553
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
jchc7451:31067544
chatpanelc:31048052
dsvsc021:30996838
0ee40948:31013168
pythoncenvpt:31062603
a69g1124:31058053
dvdeprecation:31068756
dwnewjupyter:31046869
impr_priority:31082723

@war-live
Copy link
Author

Picture before column resizing
image
after resizing, note missing number to right instead of left
image

@pwang347 pwang347 added the enhancement New feature or request label Jul 17, 2024
@pwang347
Copy link
Member

Hi @war-live, just wanted to let you know that we've merged a fix to address this in the latest pre-release v1.5.4. Please feel free to give it a try and let me know what you think!

@war-live
Copy link
Author

war-live commented Jul 25, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants