<jupyter_start><jupyter_text>canada net income  at 2020???<jupyter_code>import pandas as pd
import matplotlib.pyplot as plt
from sklearn import linear_model
df=pd.read_csv("canada.csv")
df.head()
# plt.scatter(df.year,df.percapitaincome(US$))
#re name columns bcz easy to understand
df.rename(columns={"per capita income (US$)":"income"},inplace=True)
df.head()
plt.scatter(df.year,df.income)
plt.xlabel("years")
plt.ylabel("income")
plt.title("canada income data")
#model object
reg=linear_model.LinearRegression()
#predict--train
reg.fit(df[['year']],df.income)
reg.predict([[2020]])
plt.scatter(df.year,df.income)
plt.xlabel("years")
plt.ylabel("income")
plt.title("canada income data")
plt.plot(df.year,reg.predict(df[['year']]),color="red")
reg.predict([[2050]])
#calculate for many years
df=pd.read_csv("years.csv")
df
incomes=reg.predict(df)
incomes
df['new_income']=incomes
df
income=df.to_csv("new_income_years.")
income<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.17831074035453598, 'fraction_numerical': 0.01251303441084463, 'mean_word_length': 8.504950495049505, 'pattern_counts': {'":': 1, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '419043', 'license': 'MIT', 'n_tokens_mistral': 398, 'n_tokens_neox': 367, 'n_words': 63, 'path': 'linearregression.ipynb', 'repo_name': 'hkr007/LinearRegression', 'size': '959'}