Spaces:
Sleeping
Sleeping
MilesCranmer
commited on
Commit
•
338c00b
1
Parent(s):
44aefe9
Fix custom variable names
Browse files- Fixes https://github.com/MilesCranmer/PySR/issues/162
- pysr/sr.py +1 -1
pysr/sr.py
CHANGED
@@ -1133,7 +1133,7 @@ class PySRRegressor(MultiOutputMixin, RegressorMixin, BaseEstimator):
|
|
1133 |
"Spaces have been replaced with underscores. \n"
|
1134 |
"Please rename the columns to valid names."
|
1135 |
)
|
1136 |
-
elif variable_names and [" " in name for name in variable_names]
|
1137 |
variable_names = [name.replace(" ", "_") for name in variable_names]
|
1138 |
warnings.warn(
|
1139 |
"Spaces in `variable_names` are not supported. "
|
|
|
1133 |
"Spaces have been replaced with underscores. \n"
|
1134 |
"Please rename the columns to valid names."
|
1135 |
)
|
1136 |
+
elif variable_names and any([" " in name for name in variable_names]):
|
1137 |
variable_names = [name.replace(" ", "_") for name in variable_names]
|
1138 |
warnings.warn(
|
1139 |
"Spaces in `variable_names` are not supported. "
|