Guest User

Untitled

a guest
Jan 21st, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. end = smooth(data,window_len=40)
  2. plot.plot(time[0:len(end)],end)
  3. plot.savefig('hanning(40).pdf') #problem line
  4.  
  5. plot.savefig('hanning',num,'.pdf')
  6.  
  7. plot.savefig('hanning(%d).pdf' % num)
  8.  
  9. plot.savefig('hanning' + str(num) + '.pdf')
  10.  
  11. plot.savefig('hanning%s.pdf' % num)
  12.  
  13. plot.savefig('hanning%(num)s.pdf' % locals()) # Neat trick
  14.  
  15. plot.savefig('hanning{0}.pdf'.format(num)) # Note: This is the new preferred way
  16.  
  17. plot.savefig(f'hanning{num}.pdf') # added in Python 3.6
  18.  
  19. plot.savefig(string.Template('hanning${num}.pdf').substitute(locals()))
  20.  
  21. >>> name = "Fred"
  22. >>> f"He said his name is {name}."
  23. 'He said his name is Fred.'
  24.  
  25. plot.savefig(f'hanning{num}.pdf')
  26.  
  27. "hello " + str(10) + " world" = "hello 10 world"
  28.  
  29. stringExample = "someString " + str(someNumber)
  30. print(stringExample)
  31. plot.savefig(stringExample)
  32.  
  33. ['file' + str(i) + '.pdf' for i in range(1,4)]
  34.  
  35. nums = [1,2,3]
  36. plot.savefig('hanning{0}{1}{2}.pdf'.format(*nums))
Add Comment
Please, Sign In to add comment