Message from Python discussions
December 2018
— Take a peek, guys
Guys a problem in writing an array and a list to a txt file using numpy.savetxt
numpy.savetxt('fourier-abs',numpy.c_[tt,yf_abso])
'tt' is a list and
'yf_abso' is a numpy.ndarray
when we put each of them alone, as argument for numpy.savetxt, it is working and the contents are written to the txt file... but when I put them together I'm getting an error as follows
TypeError :Mismatch between array dtype ('|S32') and format specifier ('%.18e %. 18e')
how can we fix this? I just need to write the contents of the list and the array to txt file, with the first column as tt and second column as fft_abso.
please suggest.
— No
— What is funky is your indentation
— Nop use readline() instead,, dont misuse threads😃
— Readline() is ancient. just iterate over the handle.
— How can i handle multiple websockets and save them open for long time?
Im using websockets library.
— I still use it though
— As for memoization, cachetools worked great for me
— Use
From functools import lrucache
Use it as a decorator,,, it helps in memoization and its easier actually
— But if your function isn't an expensive function then no need of using lrucache
— Yep