我是 Python 和 Stackoverflow 的新手。我有一个 .txt 文件,其中包含看起来像这样的浮点数:
8.2178200e-02
8.2173600e-02 8.2129400e-02 8.2209000e-02 8.2183000e-02 8.2098900e-02 8.2162500e-02 8.2157700e-02 8.2177900e-02 8.2177600e-02 8.2088400e-02 8.2142900e-02 8.2179600e-02 8.2159200e -02 8.2144800e-02 8.2139000e-02 8.2121200e-02 8.2157900e-02 8.2142600e-02 8.2190600e-02 8.2129500e-02 8.2125800e-02 8.2097500e-02 8.2087300e-02 8.2206800e-02 8.2175400e-02 8.2183300E-02 8.2197400E-02 8.2129500E-02 8.2101600E-02 8.2117800E-02 8.2125900E-02 8.2131300E-02 -02 8.2135300e-02 8.2119700e-02 8.2100800e-02 8.2135700e-02 8.2126900e-02 8.2134000e-02 8.2111000e-02 8.2101600e-02 8.2108600e-02 8.2142900e-02 8.2091000e-02 8.2117700e-02 8.2061400E-02 8.2085200E-02 8.2080400E-02 8.2075400E-02 8.2064400E-02 8.2059700E-02 8.2098200E-02 8.2077200E-02 8.2077200E-02 8.2138200E-02 8.2116382.201163820002820925020002000200022092502000220250200022092500020002209250925092509292929292929292999999太200099925092509999999性其中士兵02 8.2056900E-02 8.2108900E-02 8.2061300E-02 8.2064300E-02 8.2063900E-02 8.2120600E-02 8.2049500E-02 8.2049500E-02 8.2087300E-02 8.206800E-028002 8.207242 8.207499002.20242.20242.20249242.2022.2022.20200e-02 EE-02 EE-02 e-02 8.2043700e-02 8.2070500e-02 8.2056900e-02 8.2084000e-02 8.2075900e-02 8.2065900e-02 8.2054200e-02 8.2037400e-02 8.2040600e-02 8.2085500e-02 8.2029000e-02 8.2057000e- 02 8.2045700e-02 8.2112600e-02 8.2068000e-02 8.2034900e-02 8.2045200e-02 8.2046400e-02 8.2067300e-02 8.2080500e-02 8.2021400e-02 8.2047300e-02 8.2060200e-02 8.2042900e-02 8 .2065200e-02 8.2056100e-02 8.1990900e-02 8.2055700e-02 8.2030300e-02 8.2103400e-02 8.2092600e-02 8.1995200e-02 8.2075300e-02 8.2001500e-02 8.2064000e-02 8.2033500e-02 8.2042800e- 02 8.2037400E-02 8.2002000E-02 8.2057900E-02 8.2025100E-02 8.2038900E-02 8.2035200E-02 8.2005700E-02 8.2016700E-02 8.2012800E- 8.2012800E-028.2022722722722272222222222222222222222222222222222222222222222222222222222222222222222222222222转E-02 8.2012200E-02 8.2009400E-02 8.2024900E-02 8.2038700E-02 8.2034700E-02 8.2016200E-02 8.1964500E-02 8.2019400E-02 8.2019400 EE-02 8.201500 EE-02.2.10500 EE-02 8.2002.28.200282.2.2002002.28.200200200 EE-0282.2002002002.2.2002002002.2.20020020028.2002002002002 02 8.2004500E-02 8.1998400E-02 8.2011600E-02 8.2038400E-02 8.2002500E-02 8.2005700E-02 8.2065900E-02 8.19991200E-0E-02 8.202 8.2039900E-02827272727272727272727272720282028202820282.2002828200 EE-028282828282828282828282828200 EE-0200 EE-0200 EE-0200 EE-0200 EE-0200 EE-0200 EE-0200 EE-0200 EE-0200 EE-0200 EE-10 .2019600E-02 8.2032900E-02 8.2011700E-02 8.2017400E-02 8.2069400E-02 8.1998400E-02 8.2059400E-02 8.1958300E-02 8.1995800E-02 8.1995800E-02 8.20181828.28002.18282.18518182.85185EE-02 02 8.1989400e-02 8.1991800e-02 8.2000600e-02 8.2040400e-02 8.2035700e-02 8.1987800e-02 8.2027400e-02 8.2010800e-02 8.1991300e-02 8.1999400e-02 8.1926800e-02 8.2021100e-02 8.1967800 e-02 8.1992600e-02 8.2022200e-02 8.1933100e-02 8.1998900e-02 8.2004300e-022010800e-02 8.1991300e-02 8.1999400e-02 8.1926800e-02 8.2021100e-02 8.1967800e-02 8.1992600e-02 8.2022200e-02 8.1933100e-02 8.1998900e-02 8.2004300e-022010800e-02 8.1991300e-02 8.1999400e-02 8.1926800e-02 8.2021100e-02 8.1967800e-02 8.1992600e-02 8.2022200e-02 8.1933100e-02 8.1998900e-02 8.2004300e-02
如何构建一个将这些数据放入字符串的程序,我需要用它来获取频率响应并使用 Matplotlib 绘制数据?数据量将是未知的。对于 y 轴,绘制了数据点。对于 x 轴,数字以 1 递增,[0,1,2,3,4,5,6...n]。如果有更好的方法来实现这一点,请详细说明。谢谢!