I want to study machine learning, Because I found a gap time and sporadically moved it by trial and error such as anaconda and vscode The execution environment has begun to get confused. .. .. Since we have rebuilt from zero base, we will summarize the procedure.
This article is composed of these two parts.
Specifically, we will do the following.
Install python from the following https://www.python.org/downloads/windows/
Choose from Stable Releases This time, I chose "Windows x86-64 executable installer".
The exe file will be dropped, so install it quickly.
Then, I would like to recreate the environment with vscode. An icon that looks like the "rice field" on the far left is broken (select the extension)
Then type "python" and install the python that probably hits the top
↓↓
At the same time, the dependent jupyter will also be installed
Then specify the Python path. Select Settings for Preferenes
And if you hit the following command
python.pythonpath
The screen for specifying the path will be displayed, so enter the correct path.
To find out the path in windows, I think you should open the executable file.
If you install it normally, you will lose such a path
user
C:\Users\*****\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Python 3.9
workspace
C:\Users\*****\AppData\Local\Programs\Python\Python39\python.exe
Then, create a hello.py file and execute it with the following contents.
msg = "hello world!"
print(msg)
Execution result ↓
hello world!
Congratulations! Now you have a minimum environment for python to work! !! !!
Because numpy and matplotlib are required Install using pip.
First of all, let's update pip.
py -m pip install -U pip
To install NumPy, execute the following command.
py -m pip install numpy
To install matplotlib, execute the following command.
py -m pip install matplotlib
The library environment for drawing graphs is now ready.
Let's overwrite and execute hello.py as follows without detailed explanation.
import numpy as np
import matplotlib.pyplot as plt
msg = "Hello numpy and matplotlib"
print(msg)
x = np.linspace(0, 1, 5)
y = x ** 2
plt.plot(x, y)
plt.show()
If you can draw the graph below, you are successful!
The purpose of this article has been achieved, so it ends here! Thank you for your hard work!
For the purpose of using python If you want to do regression analysis etc., it is a good idea to include the pandas library at the same time.
py -m pip install pandas
With this, you can make up for missing data, sort data, etc. It is a library that is useful when preparing for analysis.