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

RAND Error: ValueError: high <= 0 #1

Open
GerbilPL opened this issue Apr 16, 2024 · 0 comments
Open

RAND Error: ValueError: high <= 0 #1

GerbilPL opened this issue Apr 16, 2024 · 0 comments

Comments

@GerbilPL
Copy link
Contributor

Generation of new data is hindered by these errors, with nothing changed and requirements met.
Traceback (most recent call last):
File "gen.py", line 156, in
print(gen.generate())
File "gen.py", line 147, in generate
**self._generate_endpoints(),
File "gen.py", line 41, in _generate_endpoints
endpoints[endpoint] = np.random.randint(self.example_data[endpoint].max(), size=self.rows)
File "numpy/random/mtrand.pyx", line 782, in numpy.random.mtrand.RandomState.randint
File "numpy/random/_bounded_integers.pyx", line 1334, in numpy.random._bounded_integers._rand_int64
ValueError: high <= 0
This error is true for each rand call.
With rand error corrected:
It also should be noted that when some columns are empty, this can happen:
Traceback (most recent call last):
File "gen.py", line 156, in
print(gen.generate())
File "gen.py", line 147, in generate
**self._generate_endpoints(),
File "gen.py", line 57, in _generate_endpoints
endpoints[endpoint] = np.random.randint(0,self.example_data[endpoint].max()+1, size=self.rows)
File "numpy/random/mtrand.pyx", line 782, in numpy.random.mtrand.RandomState.randint
File "numpy/random/_bounded_integers.pyx", line 1324, in numpy.random._bounded_integers._rand_int64
ValueError: cannot convert float NaN to integer
Adding a zero to the problematic columns, fixes this ( so almost all ,, null ones )
history_fixed.csv
history_nan_err.csv
Proposed quick fix will be in pull requests

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

No branches or pull requests

1 participant