Python | Numpy np.disp() method
Last Updated :
02 Dec, 2019
With the help of np.disp()
method, we can get the string into a display buffer and by using stringIO class we can get the values from buffer by using np.disp()
method.
Syntax : np.disp(message, device)
Return : Will not return anything without StringIO class.
Example #1 :
In this example by using np.disp()
method, we are able to collect message from parameter and put that message into display buffer by using this method.
import numpy as np
from io import StringIO
buf = StringIO()
np.disp(u 'Geeks For Geeks' , device = buf)
buf.getvalue()
|
Output :
‘Geeks For Geeks\n’
Example #2 :
import numpy as np
from io import StringIO
buf = StringIO()
np.disp(u 'Author "Jitender Kumar"' , device = buf)
buf.getvalue()
|
Output :
‘Author “Jitender Kumar”\n’
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...