python beginner memo (9.2-10)

I put vscode and anaconda

・ I managed to put it in while searching on the Internet, setting.jonson ...

regression analysis

Simple regression ... Estimating another (objective variable) from one value (explanatory variable) y = x + 2, etc., supervised learning Multiple regression ... Multiple explanatory variables, y = ax1 + bx2 + cx3 + ...

Multiple regression method Prepare an element → Use LinearRegression () Learn → .fit (x, y) Predict → Can be done with .predict (x)

How good is the regression? Uses the coefficient of determination .score (x, y) Run with jupyter notebook

Question

% matplotlib inline What? Why is it possible to use characters's% instead of characters + variables when outputting an array? What is the enumate function

numpy various


axis #(1 for rows, 0 for columns)
np.random.randint(0,100,3) #(Generate 3 integers from 0 to 100)

About RNNs and DNNs

Omitted here

About the argument *


def sample(*words,sep="/"):
    return sep.join(words) #Use join to concatenate characters
sample("a","b","c") 
# a/b/Displayed with c ・ Sep indicates how to divide between

def sample(**words):
    print(words)

sample(a="A",b="B",c="C")

zip function ... Tuples can be listed map function .. Apply operation to each element of list → You don't have to use for loop! Use anonymous function ... lambda. Convenient to keep short

a=[1,2,3]
b=[4,5,6]
c=[7,8,9]
l=zip(a,b,c)

print(list(l))
#[(1, 4, 7), (2, 5, 8), (3, 6, 9)]

def threepow(x):
    return x**3
ans=list(map(threepow,a))
print(ans)
#[1, 8, 27]


d=list(map(lambda i:i**3, a))
print(d)
#[1, 8, 27],Only 2 lines

Use Pandas

Benefits of pandas

-Easy data analysis (like SQL or R!) ・ There are many such functions ・ Various types can be used together

Recommended Posts

python beginner memo (9.2-10)
python beginner memo (9.1)
Python beginner memo (2)
Python memo
python memo
Python memo
python memo
Python memo
Python memo
Python memo
Beginner ABC154 (Python)
[Python] Memo dictionary
Beginner ABC156 (Python)
Python beginner notes
[Beginner] Python array
★ Memo ★ Python Iroha
Beginner ABC155 (Python)
[Python] EDA memo
Python 3 operator memo
[Beginner] Python functions
Beginner ABC157 (Python)
PyQ ~ Python Beginner ~
[My memo] python
Python3 metaclass memo
[Python] Basemap memo
Python beginner Zundokokiyoshi
[Python] Numpy memo
Python beginner Atcoder memo @ KEYENCE 2020, ABC problem
[Python beginner memo] Python character string, path operation
Python class (Python learning memo ⑦)
My python environment memo
python openCV installation (memo)
Python module (Python learning memo ④)
Visualization memo by Python
Python test package memo
[Python] Memo about functions
python regular expression memo
Binary search (python2.7) memo
[My memo] python -v / python -V
Python3 List / dictionary memo
[Memo] Python3 list sort
Python Tips (my memo)
[Python] Memo about errors
DynamoDB Script Memo (Python)
Python basic memo --Part 2
python recipe book Memo
Basic Python command memo
Python OpenCV tutorial memo
Python basic grammar memo
TensorFlow API memo (Python)
python useful memo links
Python decorator operation memo
Python basic memo --Part 1
Effective Python Memo Item 3
Divisor enumeration Python memo
A memo for creating a python environment by a beginner
Python memo (for myself): Array
Python exception handling (Python learning memo ⑥)
Python execution time measurement memo
python super beginner tries scraping
Python