Can you try the following:
df['income'] = df['income'].str.replace(',', '').astype(float)
df['year'] = df['year'].astype(float)
reg.fit(df[['year']], df.income)
More Related Contents:
- How do I increase the cell width of the Jupyter/ipython notebook in my browser?
- How to display full output in Jupyter, not only last result?
- How do I get the current IPython / Jupyter Notebook name
- How to use Jupyter notebooks in a conda environment?
- Running Jupyter via command line on Windows
- How to load/edit/run/save text files (.py) into an IPython notebook cell?
- sys.path different in Jupyter and Python – how to import own modules in Jupyter?
- Link Conda environment with Jupyter Notebook
- What is the currently correct way to dynamically update plots in Jupyter/iPython?
- Installing a pip package from within a Jupyter Notebook not working
- Can I run Keras model on gpu?
- How to execute a * .PY file from a * .IPYNB file on the Jupyter notebook?
- How do I run Python asyncio code in a Jupyter notebook?
- How can I share Jupyter notebooks with non-programmers? [closed]
- How to uninstall jupyter
- Get Output From the logging Module in IPython Notebook
- Connecting to a remote IPython instance
- jupyter ModuleNotFoundError: No module named matplotlib
- What is the meaning of exclamation and question marks in Jupyter notebook?
- How to programmatically generate markdown output in Jupyter notebooks?
- How to embed image or picture in jupyter notebook, either from a local machine or from a web resource?
- How to close IPython Notebook properly?
- Simple way to measure cell execution time in ipython notebook
- How to disable password request for a Jupyter notebook session?
- jupyter notebook running kernel in different env
- Overwrite previous output in jupyter notebook
- Plotly chart not showing in Jupyter notebook
- Execute Python script within Jupyter notebook using a specific virtualenv
- What does In [*] in IPython Notebook mean and how to turn it off? [duplicate]
- How do I add a kernel on a remote machine in IPython (Jupyter) Notebook?