Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- end = smooth(data,window_len=40)
- plot.plot(time[0:len(end)],end)
- plot.savefig('hanning(40).pdf') #problem line
- plot.savefig('hanning',num,'.pdf')
- plot.savefig('hanning(%d).pdf' % num)
- plot.savefig('hanning' + str(num) + '.pdf')
- plot.savefig('hanning%s.pdf' % num)
- plot.savefig('hanning%(num)s.pdf' % locals()) # Neat trick
- plot.savefig('hanning{0}.pdf'.format(num)) # Note: This is the new preferred way
- plot.savefig(f'hanning{num}.pdf') # added in Python 3.6
- plot.savefig(string.Template('hanning${num}.pdf').substitute(locals()))
- >>> name = "Fred"
- >>> f"He said his name is {name}."
- 'He said his name is Fred.'
- plot.savefig(f'hanning{num}.pdf')
- "hello " + str(10) + " world" = "hello 10 world"
- stringExample = "someString " + str(someNumber)
- print(stringExample)
- plot.savefig(stringExample)
- ['file' + str(i) + '.pdf' for i in range(1,4)]
- nums = [1,2,3]
- plot.savefig('hanning{0}{1}{2}.pdf'.format(*nums))
Add Comment
Please, Sign In to add comment