Different results for numpy.fft.fft() when passing different types of argument (DataFrame, np.array) with the same valuesBUG: <Please write a comprehensive title after the 'BUG: ' prefix> · Issue #23873 · numpy/numpy · GitHub
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Different results for numpy.fft.fft() when passing different types of argument (DataFrame, np.array) with the same valuesBUG: <Please write a comprehensive title after the 'BUG: ' prefix>
#23873
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
From the attached CSV file, input_data.csv, I import the, say, test_list. Then, I create a pd.Dataframe to store my data in test_df.
from scipy import fft
import numpy as np
test_df = pd.DataFrame(index=range(len(test_list)), columns=['test'])
test_df['test'] = test_list
I want to calculate the FFT transform of the signal in test_df['test']. However, I get different results when I pass as input different types of arguments to the scipy.fft.fft().
Once I pass the signal as a nympy.array I get the plot #1.
Once I pass the signal as a pd.Dataframe I get the plot #2.
Both inputs, np.array and pd.DataFrame contain the same information.
From the problem definition the plot#2 seems to have a better physical interpretation.
However, it is not clear why I get different results.
It looks like you're using scipy's fft module, so I figured scipy was more appropriate. However, if you've done some additional digging then please feel free to close that and reopen this as you see fit!
In this version of issue I use numpy. fft_output = numpy.fft.fft(to_df) i tested both ways (scipy and numpy) and I after realized that it is a numpy issue
Describe the issue:
Describe your issue.
From the attached CSV file, input_data.csv, I import the, say,
test_list
. Then, I create apd.Dataframe
to store my data intest_df
.I want to calculate the FFT transform of the signal in
test_df['test']
. However, I get different results when I pass as input different types of arguments to thescipy.fft.fft()
.Once I pass the signal as a nympy.array I get the plot #1.
Once I pass the signal as a pd.Dataframe I get the plot #2.
Both inputs, np.array and pd.DataFrame contain the same information.
From the problem definition the plot#2 seems to have a better physical interpretation.
However, it is not clear why I get different results.
May be it is a bug?
The code I use is below:
Reproduce the code example:
Error message:
No response
Runtime information:
1.23.5
3.9.16 | packaged by conda-forge | (main, Feb 1 2023, 21:38:11)
[Clang 14.0.6 ]
Context for the issue:
No response
The text was updated successfully, but these errors were encountered: