MoreRSS

site iconXiangyunHuang | 黄湘云修改

技术写作与交流,专注R语言和统计图形,活跃于中国R语言大会及统计之都。
请复制 RSS 到你的阅读器,或快速订阅到 :

Inoreader Feedly Follow Feedbin Local Reader

XiangyunHuang | 黄湘云的 RSS 预览

Tensorflow 的张量(多维数组)操作

2025-10-31 08:00:00

1 准备

创建数组

import tensorflow as tf
A = tf.constant([[1.0, -1.0], [1.0, 1.0]])
A
## <tf.Tensor: shape=(2, 2), dtype=float32, numpy=
## array([[ 1., -1.],
##        [ 1.,  1.]], dtype=float32)>
import numpy as np
a = np.array([[1., -1.], [1., 1.]])
a
## array([[ 1., -1.],
##        [ 1.,  1.]])

2 张量操作

2.1 基础操作

均值和矩阵乘法

SciPy 做科学计算

2025-10-18 08:00:00

SciPy 是基于 NumPy 做科学计算的 Python 模块,它的官网没有类似 NumPy 和 Pandas 的快速入门文档,但有一个按功能分类的用户指南。本文介绍 SciPy 提供的基础算法,涵盖优化、积分、插值、特征值问题、代数方程、微分方程、统计学等功能。

湖南省统计年鉴(区县级)

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

变了

部分新建住房、白事活动现场、村服务中心。

没变

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

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

做菜

再来点轻松的,只会做简单的饭菜,只够做自己的口味。