Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tianlh
LightGBM-DCU
Commits
7577a363
"src/vscode:/vscode.git/clone" did not exist on "631e0a2a7bdd694a91f30378fb271d05ce438122"
Commit
7577a363
authored
Oct 26, 2017
by
Guolin Ke
Committed by
GitHub
Oct 26, 2017
Browse files
fix _load_pandas_categorical
parent
95519f36
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
python-package/lightgbm/basic.py
python-package/lightgbm/basic.py
+4
-1
No files found.
python-package/lightgbm/basic.py
View file @
7577a363
...
...
@@ -282,7 +282,10 @@ def _save_pandas_categorical(file_name, pandas_categorical):
def
_load_pandas_categorical
(
file_name
):
with
open
(
file_name
,
'r'
)
as
f
:
last_line
=
f
.
readlines
()[
-
1
]
lines
=
f
.
readlines
()
last_line
=
lines
[
-
1
]
if
last_line
.
strip
()
==
""
:
last_line
=
lines
[
-
2
]
if
last_line
.
startswith
(
'pandas_categorical:'
):
return
json
.
loads
(
last_line
[
len
(
'pandas_categorical:'
):])
return
None
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment