2025-10-18 08:00:00
SciPy 是基于 NumPy 做科学计算的 Python 模块,它的官网没有类似 NumPy 和 Pandas 的快速入门文档,但有一个按功能分类的用户指南。本文介绍 SciPy 提供的基础算法,涵盖优化、积分、插值、特征值问题、代数方程、微分方程、统计学等功能。
2025-10-17 08:00:00
本文继《10分钟入门pandas》之后,又一篇快速入门 Python 模块的文章,来自 NumPy 的官网NumPy quickstart,也是要同步添加 R 代码实现。
2025-10-07 08:00:00
加载湖南省区县级行政区划边界地图数据
hunan_geo <- sf::read_sf("data/湖南省.json")
hunan_geo
## Simple feature collection with 122 features and 9 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: 108.8 ymin: 24.64 xmax: 114.3 ymax: 30.13
## Geodetic CRS: WGS 84
## # A tibble: 122 × 10
## adcode name childrenNum level parent subFeatureIndex center centroid
## <int> <chr> <int> <chr> <chr> <int> <list> <list>
## 1 430102 芙蓉区 0 district "{ \"adco… 0 <dbl> <dbl>
## 2 430103 天心区 0 district "{ \"adco… 1 <dbl> <dbl>
## 3 430104 岳麓区 0 district "{ \"adco… 2 <dbl> <dbl>
## 4 430105 开福区 0 district "{ \"adco… 3 <dbl> <dbl>
## 5 430111 雨花区 0 district "{ \"adco… 4 <dbl> <dbl>
## 6 430112 望城区 0 district "{ \"adco… 5 <dbl> <dbl>
## 7 430121 长沙县 0 district "{ \"adco… 6 <dbl> <dbl>
## 8 430181 浏阳市 0 district "{ \"adco… 7 <dbl> <dbl>
## 9 430182 宁乡市 0 district "{ \"adco… 8 <dbl> <dbl>
## 10 430202 荷塘区 0 district "{ \"adco… 0 <dbl> <dbl>
## # ℹ 112 more rows
## # ℹ 2 more variables: acroutes <list>, geometry <MULTIPOLYGON [°]>
加载 2023 年湖南省各区县的数据(数据来自湖南省统计局发布的统计年鉴 2024)
2025-10-07 08:00:00
部分新建住房、白事活动现场、村服务中心。





村前水坝、村二进堂屋、部分旧住房。





卫生院门口、小学校门口、小庙。


再来点轻松的,只会做简单的饭菜,只够做自己的口味。
2025-10-07 08:00:00
复现 ISLR (《Introduction to Statistical Learning with Applications in R》) 书中图 2.3 — 收入关于受教育年限、工作资历的关系。
library(readr)
# https://github.com/rghan/ISLR/blob/master/Income2.csv
Income <- read_csv("data/Income2.csv", col_types = cols(x1 = col_skip()))
拟合数据 Local Polynomial Regression Fitting
model <- loess(Income ~ Education + Seniority, data = Income)
生成预测值
2025-10-07 08:00:00
这是为 Pandas 新用户准备的简短的入门介绍,我补充了对应的 R 语言实现。对 R 语言用户来说是熟悉 Python 语言的机会,对 Python 用户来说是了解 R 语言的机会 – 左手用 R 右手用 Python 。