I am a graduate student in science who is about to get a job in April of this year. I have been simulating using MATLAB for three years in the laboratory.
So far, I've been using MATLAB, which is licensed by the university. If you become a member of society, you will not be able to use MATLAB, so The other day, I decided to learn new Python that can be used for free.
First of all, go to Yurindo in Yokohama, pick up all the Python reference books, I chose a reference book that seems to suit me.
That's how I chose, written by Dr. Akio Nishi. "I can't explain it any more easily! The first step in Python ” is. I recommend it because it is easy to understand!
In fact, I will learn Python and write what I thought.
Frankly, I thought it was similar to MATLAB and easy to learn. It was an interpreter type, and I didn't come up with such a difficult concept.
However, among them, there are two things that I struggled with, and I would like to introduce them.
The first is about array indexes. In MATLAB, the index started at "1", In Python, the index starts at "0". To be honest, I'm still unfamiliar with this.
number.m
%For MATLAB
number = [1,2,3]
%The index that specifies 1 is 1(number[1]=1)
%The index that specifies 2 is 2(number[2]=2)
%The index that specifies 3 is 3(number[3]=3)
number.py
#For Python
number = [1,2,3]
#Index that specifies 1 is 0(number[0]=1)
#The index that specifies 2 is 1(number[1]=2)
#The index that specifies 3 is 2(number[2]=3)
And the second is about classes (and object-oriented). I have never developed a large-scale system before, When writing a simulation program in the laboratory I came with a stance that I should move for the time being, so I couldn't understand it easily. (Still quite suspicious)
In addition to the reference book, Do you need a "class"? Isn't it okay with the def function? "A class is a collection of data and functions that are related to each other to make the code easier to read. It's something, "I somehow convinced.
In the future, I would like to use various libraries unique to Python. In particular, I have a strong interest in machine learning, so I would like to use TensorFlow.
Recommended Posts