How different methods of getting spectra in Python actually work? I am having issues with understanding some functions performing Fast Fourier Transform or directly producing power spectra. 
I have a signal composed of some long wavelength and some short wavelength components. So in a spectrum, I expect to see two peaks, one in the order of the shorter wavelengths and one for the longer. However, the spectrum produced is not what I would expect. I am sure it is not subsampled, there is no aliasing. The problem is more likely with the input parameters or with what I actually display.
Here is a simple example to illustrate my problem:

x = np.arange(0,10,0.01)
x = x * np.pi
y = np.sin(0.2*x)+np.cos(3*x)




Now I try to get the spectrum:

power = (2/N)*(abs(np.fft.fft(y))[0:N/2])
freq = np.linspace(0,0.5*(10/N),(N/2))
plt.plot(freq,power)


But the figure is empty. After printing my "power" and "freq" I realized that they were just zeros. I may have my "freq" defined wrong, It is true, I am not sure what is the period here. But I also tried another method:

freq, power = sp.signal.welch(y,fs=(1/(0.01*pi)))

and this produced



So I assume the sampling frequency, which is the input parameter, is incorrect here? What is the input here?

(I am sorry if it is a really stupid question, I am not proficient either at signal processing or programming.)
You made a vector of time points spaced at 0.01 seconds. So your sampling frequency is 100 Hz. 

You multiplied this time vector by $0.2\pi$ for the $\sin$ term and $3\pi$ for the $\cos$ term. So the two frequency components are 0.1 Hz and 1.5 Hz.

In your first attempt with FFT, you can get the power spectrum by calculating the square of the spectrum:

power = np.abs( np.fft.fft(y)/N )**2.0


The first half of this vector corresponds to analog frequencies from 0 to Nyquist, which in your case is 50Hz. So:

freq = np.linspace(0, 100./2, N/2)


and then plot

plt.plot( freq, power[0:N/2] )


You should see two spikes, one at 0.1 and the other at 1.5.

When using the Welch method, remember that your spectrum will get smeared and attenuated due to windowing. The right way to use that function is to provide it your sampling frequency as an input:

f, Pxx = sp.welch( y, fs=100.0 )


Since your sine wave frequency is 0.1Hz and 10 seconds of data barely fits 1 full cycle of the sine wave, Welch method will not be able to pick out that low frequency very well. If you increase your signal length to, say, 100 seconds and try the same thing with a longer window parameter, say nperseg=1024, you'll see a much cleaner double peak using sp.welch.