Python
jerry173985
这个作者很懒,什么都没留下…
展开
-
fit a complex function using 101 RBF basis functions with Linear Regression
import numpy as npimport matplotlib.pyplot as pltdef rbf_tut1_q3(xx, kk, hh): """Evaluate RBF kk with bandwidth hh on points xx (shape N,)""" center = ((kk - 51) * hh) / np.sqrt(2) phi = np.exp((-(xx - center) ** 2) / hh ** 2) return ph原创 2021-10-02 21:53:11 · 164 阅读 · 0 评论 -
backup all conda envs all at once and uninstall conda
bash script to backup all conda environment lists#!bin/bashNOW=$(date "+%Y-%m-%d")CONDA_BASE=$(conda info --base)CONDA_FUNCTION="etc/profile.d/conda.sh"CONDA="$CONDA_BASE/$CONDA_FUNCTION"source $CONDAmkdir ./condaenvs-$NOWENVS=$(conda env list |原创 2020-12-31 19:53:29 · 101 阅读 · 0 评论 -
Set Python3 as default python
First, execute python to check the default python on your raspberry Pi. Press Ctrl-Z to exit.If it is python3, you can skip this section.If it is python2, you need execute the following commands to set default python to python3.Enter directory /usr/bin原创 2020-12-27 20:22:24 · 348 阅读 · 0 评论 -
Python Statement
d = {'k1':1,'k2':2,'k3':3}for item in d: print(item)>> k1>> k2>> k3# Create a dictionary view objectd.items()# Dictionary unpackingfor k,v in d.items(): v = v+1 print(k) print(v) >> k1>> 2>> k.原创 2020-12-15 23:51:59 · 454 阅读 · 0 评论 -
Python3 basics
a = 10type(a)a = 'I said :"stupid! 'type(a)>> strprint('Use \n to print a new line')s = 'Hello World'# Grab everything but the last letters[:-1]# Concatenate strings!s + ' concatenate me!'#We can use the multiplication symbol to create r原创 2020-12-15 02:37:17 · 248 阅读 · 0 评论