json_normalize - incorrect removing separator from beginning of key

This issue has been created since 2022-11-23.
print(pd.__version__)
jsn={'_id':{'a1':10,"l2":{"l3":0}}, "gg":4}
display(pd.json_normalize(jsn,sep='_'))

Actual result:

1.5.2
  gg id_a1 id_l2_l3
4 10 0

Expected result:
the "_" prefix should not be removed from the beginning of the column names.

1.5.2
  gg _id_a1 _id_l2_l3
4 10 0

This issue was introduced with the following change:
https://github.com/pandas-dev/pandas/pull/40035/files

iyonchev wrote this answer on 2022-11-23

display(pd.json_normalize(jsn,sep='_', max_level=5))
passing max_level value could be used to prevent the execution of the new methods(from the change above) and execute the main one...

jbrockmendel wrote this answer on 2022-11-29
More Details About Repo
Owner Name pandas-dev
Repo Name pandas
Full Name pandas-dev/pandas
Language Python
Created Date 2010-08-24
Updated Date 2022-12-07
Star Count 36164
Watcher Count 1118
Fork Count 15472
Issue Count 3683

YOU MAY BE INTERESTED

Issue Title Created Date Comment Count Updated Date
Not able to use more than once for Page and Profile both 0 2022-07-20 2022-11-27
openjdk-8, openjdk-11, openjdk: security update to 8u345, 11.0.16.1 and 17.0.4.1 0 2022-09-01 2022-10-05
bad user input at global offers 2 2022-09-07 2022-09-22
bug: Workspace id undefined does not exist. When setActiveWorkspaceView(). 0 2021-10-28 2022-07-22
samp-server.exe is not shut down correctly 4 2019-08-12 2022-12-06
Разгерма, которой.. нет? 3 2022-04-14 2022-11-21
Check on the double quote issue for postgres and redshift 1 2021-05-19 2022-07-22
Quotes issue - Postgresql - Develop branch vs v1.0 2 2021-03-02 2022-09-20
[download fail]: bilibili 0 2022-10-01 2022-11-25
vector(“Madrid”) - vector(“Spain”) + vector(“France”) 3 2022-03-14 2022-10-12
Request to move pronto-slim_lint runner repository into prontolabs 0 2022-02-16 2022-12-02
Extra catala markers in the website examples 21 2021-05-11 2022-12-06
Feasibility for object detection 3 2022-03-01 2022-10-29
Semantic Segmentation code 1 2022-03-06 2022-10-29
DUQ is able to estimate aleatoric uncertainty or not? 2 2022-03-16 2022-10-29
VCR Does not Record SocketTimeouts 2 2017-06-10 2022-11-06
Writing DAX for comparing result of 0 2022-10-09 2022-11-05
Data loss on a Grid VM, probably because of a Node restart. 7 2022-04-28 2022-05-21
BUG: duplicate services sometimes spawn on the node 0 2022-04-28 2022-07-05
New Yggdrasil peer list for ZOS 9 2022-05-05 2022-07-03
Compatibility update request: Dell: T7600, T7820, T7910, T7920 0 2022-05-03 2022-07-03
Document gateway flow 0 2022-05-02 2022-07-03
Investigate if we can proxy gateway into private networks 3 2022-05-02 2022-08-12
Manual upgrade of grid 0 2022-05-05 2022-07-03
add gateways network consumption reports back 0 2022-04-28 2022-07-03
PCIe Bus Error on Titan 2 2022-05-05 2022-07-03
Change promtail client url to loki.grid.tf 0 2022-04-27 2022-05-21
Crashes on startup relating to alsa and number of pcm devices 3 2021-10-31 2022-11-25
Validation made for autocomplete 3 2022-11-02 2022-11-25
Tool to split bars is missing essential steps 8 2022-09-03 2022-09-07
[MU4 Issue] Fretboard diagram: Clear button doesn't remove fret number 0 2022-09-03 2022-09-07
Add lego cli flag to add to the user-agent 2 2022-06-28 2022-11-25
Cannot assign to read only property 'selected' of object 1 2022-06-23 2022-10-26
Custom Height Error in console 4 2022-01-02 2022-11-16
New post email notification showing "unknown" when replying directly to someone. 0 2022-02-04 2022-03-03
F-Droid - Add screenshots 3 2021-09-04 2022-11-10
[gatsby-theme-i18n-react-i18next] hydrate and useTranslation 1 2021-01-24 2022-11-27
Issue with latest version of firmware (1 coordinator + 2 routers, 39 devices) 1 2021-09-24 2022-11-20
irrelevant results 0 2021-06-10 2022-01-15
Json data is shown with escape characters as non-json logs 6 2021-11-15 2022-11-12
Enormous listbucket operations when using boltdb-shipper with S3 storage 2 2021-11-14 2022-11-26
HTTP path-prefix option results to 404 on 2.4.1 15 2021-11-15 2022-11-10
Language settings confusion 4 2022-06-01 2022-10-16
请问能增加漫画观看翻页的方式吗... 0 2021-10-18 2021-12-23
[IME][Mac] Hitting Enter fires searching even while in text edit mode 6 2022-07-19 2022-08-10
use openjdk7 instead of oraclejdk7 0 2018-02-25 2022-10-16
[Accessibility][Progress Bar] Progress bars lack accessible names. 2 2021-08-04 2022-11-29
Allow to extend load path to use local packages when compiling 10 2020-07-09 2022-11-29
从3 升级到 4 之后ts各种报错 1 2021-02-22 2022-01-23
Investigate potential error in `transform` 1 2019-06-24 2022-10-29