create a new version of this code that uses yfinance to import prices for the last 25 years for qqq instead of using raw values and then make the prediction based off those 25 years:

import matplotlib.pyplot as plt

# Data
years = [1950, 1951, 1952, 1953, 1954, 1955, 1956, 1957, 1958, 1959, 1960, 1961, 1962, 1963, 1964, 1965, 1966, 1967, 1968, 1969, 1970, 1971, 1972, 1973, 1974, 1975, 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020]
values = [25.49, 27.40, 30.47, 32.57, 35.71, 38.48, 40.24, 41.76, 41.29, 43.42, 46.34, 50.24, 53.79, 57.92, 61.72, 63.34, 68.87, 73.62, 76.62, 81.07, 73.29, 78.47, 85.42, 90.40, 82.41, 90.48, 93.79, 97.72, 105.57, 118.86, 121.86, 126.73, 140.10, 162.12, 175.92, 193.42, 210.73, 238.83, 259.28, 282.75, 253.20, 274.92, 309.42, 345.75, 366.83, 384.62, 433.68, 456.48, 489.22, 522.83, 526.91, 461.80, 395.03, 459.92, 518.87, 553.53, 609.14, 691.79, 897.22, 1111.92, 1211.92, 1257.60, 1361.01, 1648.36, 1848.36, 2043.94, 2238.83, 2673.61, 2709.94, 3223.94, 3586.01]

# AI-selected methodology for prediction
def predict(years, values):
 # Use a polynomial curve fit to predict the next 10 years
 z = np.polyfit(years, values, 3)
 f = np.poly1d(z)
 
 # Predict the values for the next 10 years
 next\_years = list(range(2021, 2031))
 next\_values = f(next\_years)
 
 return next\_years, next\_values

# Predict the values for the next 10 years
next\_years, next\_values = predict(years, values)

# Plot the data
plt.plot(years, values, 'bo', label='Actual values')
plt.plot(next\_years, next\_values, 'r', label='Predicted values')
plt.xlabel('Year')
plt.ylabel('Value')
plt.title('Prediction of values for the next 10 years')
plt.legend()
plt.show()
이 코드의 새 버전을 생성하여 원시 값을 사용하는 대신 yfinance를 사용하여 지난 25년간의 qqq 가격을 가져온 다음 25년을 기준으로 예측을 수행합니다:matplotlib.pyplot을 plt로 가져옵니다.# 데이터년 = [1950, 1951, 1952, 1953, 1954, 1955, 1956, 1957, 1958, 1959, 1960, 1961, 1962, 1963, 1964, 1965, 1966, 1967, 1968, 1969, 1970, 1971, 1972, 1973, 1974, 1975, 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020]values = [25.49, 27.40, 30.47, 32.57, 35.71, 38.48, 40.24, 41.76, 41.29, 43.42, 46.34, 50.24, 53.79, 57.92, 61.72, 63.34, 68.87, 73.62, 76. 62, 81.07, 73.29, 78.47, 85.42, 90.40, 82.41, 90.48, 93.79, 97.72, 105.57, 118.86, 121.86, 126.73, 140.10, 162.12, 175.92, 193.42, 210.73, 238. 83, 259.28, 282.75, 253.20, 274.92, 309.42, 345.75, 366.83, 384.62, 433.68, 456.48, 489.22, 522.83, 526.91, 461.80, 395.03, 459.92, 518. 87, 553.53, 609.14, 691.79, 897.22, 1111.92, 1211.92, 1257.60, 1361.01, 1648.36, 1848.36, 2043.94, 2238.83, 2673.61, 2709.94, 3223.94, 3586.01]# 예측을 위해 AI가 선택한 방법론def predict(years, values): # 다항식 곡선 적합을 사용하여 향후 10년을 예측합니다. z = np.polyfit(years, values, 3) f = np.poly1d(z)  # 다음 10년간의 값을 예측합니다. next\_years = list(range(2021, 2031)) next\_values = f(next\_years)  반환 next\_years, next\_values# 향후 10년간의 값을 예측합니다.next\_years, next\_values = predict(years, values)# 데이터를 플롯합니다.plt.plot(years, values, 'bo', label='실제 값')plt.plot(next\_years, next\_values, 'r', label='예측값')plt.xlabel('Year')plt.ylabel('값')plt.title('향후 10년간의 값 예측')plt.legend()plt.show()