Re: Printing a generator returns "", need to print its values

2016-12-05 Thread Steve D'Aprano
On Tue, 6 Dec 2016 05:39 am, vmaha...@centerpointmedia.com wrote: > Can someone help me print a generator object? The same way as you print any other object: print(obj) # Python 3 print obj # Python 2 But what you're actually asking for is a way to print the values produced by the

Re: Printing a generator returns "", need to print its values

2016-12-05 Thread Irmen de Jong
On 5-12-2016 19:39, vmaha...@centerpointmedia.com wrote: > On Wednesday, November 16, 2016 at 3:25:39 PM UTC-5, Peter Otten wrote: >> vmaha...@centerpointmedia.com wrote: >> >>> I am running Python2.7, wherein I am running the following price of code: >>> >>> y =

Re: Printing a generator returns "", need to print its values

2016-12-05 Thread vmahajan
On Wednesday, November 16, 2016 at 3:25:39 PM UTC-5, Peter Otten wrote: > vmaha...@centerpointmedia.com wrote: > > > I am running Python2.7, wherein I am running the following price of code: > > > > y = m.predict(input_fn=lambda:input_fn(df_predict), as_iterable=True) > > print ('Predictions:

Re: Printing a generator returns "", need to print its values

2016-11-16 Thread Peter Otten
vmaha...@centerpointmedia.com wrote: > I am running Python2.7, wherein I am running the following price of code: > > y = m.predict(input_fn=lambda:input_fn(df_predict), as_iterable=True) > print ('Predictions: {}'.format(str(y))) > > The output of the following is "" 0x7f0476373e10>" > >

Re: Printing a generator returns "", need to print its values

2016-11-16 Thread MRAB
On 2016-11-16 20:01, vmaha...@centerpointmedia.com wrote: I am running Python2.7, wherein I am running the following price of code: y = m.predict(input_fn=lambda:input_fn(df_predict), as_iterable=True) print ('Predictions: {}'.format(str(y))) The output of the following is """ However, the

Printing a generator returns "", need to print its values

2016-11-16 Thread vmahajan
I am running Python2.7, wherein I am running the following price of code: y = m.predict(input_fn=lambda:input_fn(df_predict), as_iterable=True) print ('Predictions: {}'.format(str(y))) The output of the following is """ However, the desired output must be in the format [1 0 0 1 1 0 0 1]. Can