Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
生成一个 csv 文件,其中每列是频率为 1 Hz、2 Hz、3Hz、4Hz、5Hz、6Hz 和 7 Hz 的正弦波数据。幅度为一伏。一个周期应该有 100 个点,因此七个波中应该有 700 个点。
以下是我将如何去做:
import pandas as pd import numpy as np freqs = list(range(1, 9)) time = np.linspace(0, 2*np.pi, 100) data = {f"{freq}Hz": np.sin(2 * np.pi * freq * time) for freq in freqs} df = pd.DataFrame(data) df.head()