Sharing some programming knowledge.

0%

Step 0: 安装合适的LaTex

  1. 安装LaTeX的发行版,最好选择texlive-full: sudo apt install texlive-full
  2. 安装xelatex编译引擎,即一个把Tex语言转换为排版的一个程序,支持unicode编码: sudo apt install texlive-xetex
  3. 安装中文包,xeCJK: sudo apt install texlive-lang-chinese
  4. 额外的字体支持: sudo apt install texlive-fonts-extra
Read more »

Install LaTeX

  1. Install LaTeX: sudo apt install texlive-full
  2. Install LaTeX compile engine: sudo apt install texlive-xetex
  3. Fonts support: sudo apt install texlive-fonts-extra
  4. (optional)Install GUI editor: sudo apt install texstudio

Configure settings in Vscode

  1. Install LaTeX Workshop extension
  2. Open command pallete:ctrl+shift+P, type settings.json to open settings
  3. Add the following code to settings.json:
Read more »

Network Manager L2TP是一个功能强大的网络工具,尤其适用于配置VPN。

Step 1: 安装 network-manager-l2tp-gnome 软件包

在terminal中运行:sudo apt install network-manager-l2tp-gnome

如果安装包没找到,可能需要添加官方的“universe”仓库源代码:

sudo add-apt-repository universe
sudo apt update
Read more »

In Python, there are many plotting libraries like matplotlib, pandas visualization, seaborn or plotly. Among them, matplotlib and pandas visualization are bases and they are the most common way to plot basic graphs. In this article, I would like to summarise the syntax of using them and try to offer a clear explaination in a plain way.

Read more »

groupby()

1
import pandas as pd
1
2
users = pd.read_csv("https://raw.githubusercontent.com/justmarkham/DAT8/master/data/u.user", sep="|", index_col='user_id')
users.head()

age gender occupation zip_code
user_id
1 24 M technician 85711
2 53 F other 94043
3 23 M writer 32067
4 24 M technician 43537
5 33 F other 15213
1
2
# Use DataFrame.groupby() to return a groupby object
users.groupby("occupation")
<pandas.core.groupby.generic.DataFrameGroupBy object at 0x7f68cbf2c790>
Read more »

  • Usage (Example): sudo ln -s ~/Downloads/eigen/Eigen /usr/local/include/Eigen
  • After doing this, /usr/local/include/Eigen will link to the original folder ~/Downloads/eigen/Eigen, so the compiler will be able to detect Eigen library.
  • Note: -s means the link is permanant ( will not disappear after rebooting ); must provide full paths rather than relative paths.
Read more »

Check the Null Data

1
2
3
4
5
6
7
8
# check which cells in your DataFram are null (return a dataframe)
df.isnull()

# is any column null ? (return a series)
df.isnull().any()

# count the number of nulls in each column (return a series)
df.isnull().sum()
Read more »

Series

Create Series

1
2
3
4
5
6
7
8
9
10
11
# create Series from ndarray
arr = np.array([1,2,3])
ser = pd.Series(arr, index=['a','b','c'])

# create Series from dict
dic = {'a':1, 'b':2, 'c':3}
ser = pd.Series(dic)

# create Series from list
lis = [1,2,3]
ser = pd.Series(lis, index=['a','b','c'])
Read more »