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

Empty progress bar with np.arange() #868

Closed
CleHou opened this issue Dec 21, 2019 · 8 comments
Closed

Empty progress bar with np.arange() #868

CleHou opened this issue Dec 21, 2019 · 8 comments

Comments

@CleHou
Copy link

CleHou commented Dec 21, 2019

Hello,

I'm using the tqdm library for a standard progression bar on a np.arange.
However, before the normal progress bar I get an empty progress bar the shows and I found no way to see where it is from.

The code has this general shape:

def function_1 (parameter_A):
    list = numpy.arrange(0,20)
    for a_value in tqdm.tqdm(list):
        #do_something_with_parameter_A

def function_2(Parameter_A):
    for k in range(30):
        print('Tree', k, '/30')
        function_1 (parameter_A)

Is there something that should be done with the array?
Thank you!

image

@CleHou CleHou changed the title Empty progress bar in the middle of the code Empty progress bar in the middle of the code with np.arange() Dec 21, 2019
@CleHou CleHou changed the title Empty progress bar in the middle of the code with np.arange() Empty progress bar with np.arange() Dec 21, 2019
@casperdcl
Copy link
Sponsor Member

You should use tqdm.write(str()) instead of print()

@CleHou
Copy link
Author

CleHou commented Dec 22, 2019

Thank you for your answer but I have tried that before and it didn't work.
But by further investigating the issue, I've definitely narrowed it down to that string. I was wrong by supposing that the issue came from the bumpy array.

def function_1 (parameter_A):
    list = numpy.arrange(0,20)
    for a_value in tqdm.tqdm(list):
        #do_something_with_parameter_A

def function_2 (Parameter_A):
    for k in range(30):
        tqdm.tqdm.write(str('Tree', k, '/30'))
        function_1 (parameter_A)

image

@casperdcl
Copy link
Sponsor Member

Ah k is mutil-line str... that's currently not supported neatly by write.

@CleHou
Copy link
Author

CleHou commented Dec 25, 2019

Ok thanks!

@CleHou CleHou closed this as completed Dec 25, 2019
@casperdcl
Copy link
Sponsor Member

duplicate of #737

@casperdcl
Copy link
Sponsor Member

Actually no, the screenshot doesn't look like you ran the code. Will have to investigate more.

@CleHou
Copy link
Author

CleHou commented Dec 25, 2019

I omitted, for simplicity, the full print.
The other part of the came from: sklearn.metrics.confusion_matrix()

@casperdcl
Copy link
Sponsor Member

ok so #737 indeed

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

2 participants