一. 前言
业精于勤, 荒于嬉, 行成于思, 毁于随.
-- 韩愈 < 进学解 >
相比于MySQL
, 同样作为开源的关系型数据库(RDBMS), PostgreSQL(ORDBMS)
的知名度远低于前者(至少在国内是如此). 但是随着MySQL
被甲骨文收购(引起开源社区和其他大型存在业务竞争公司的担忧), 以及大数据的兴起, 近年PostgreSQL
颇有异军突起的迹象.
本文作为MySQL使用指南
的延申讨论
As mentioned previously, recursive common table expressions (CTEs) are frequently used for series generation and traversing hierarchical or tree-structured data.
mycli
BlackLivesMatter
We value the diversity of our community. We strive to amplify the voices of the oppressed to eradicate racism and xenophobia. We ask our community to stand together in support of the Black community.
MyCLI is a command line interface for MySQL, MariaDB, and Percona with auto-completion and syntax highlighting.
- Source: https://github.com/dbcli/mycli
- Bug tracker: https://github.com/dbcli/mycli/issues
(注意, 可以直接输入密码)
mycli
, 一款支持自动补全代码的命令工具, 支持ssh
, 以及更多细节的优化, 如大量结果不会一次全部返回, 危险操作提示等.
本文是作为MySQL使用指南
一文的进一步细节延申和补充.
(由于Typora的字数超过2万速度会明显下降, 4万字已经出现卡顿, 这里将更多内容拆出来讨论).
# 创建测试的表
drop table if exists test_w;
create table test_w (
id int UNSIGNED not null PRIMARY key auto_increment,
grade float UNSIGNED not null,
birth_date date not null,
s_name varCHAR(15) not null,
address varchar(16) not null
);
new features:
index
完善对numpy
数据类型的支持pyarrow
数据类型的支持Copy-on-Write
)性能What’s new in 2.0.0 (March XX, 2023)
These are the changes in pandas 2.0.0. See Release notes for a full changelog including other versions of pandas.
简化, 并不是逐句翻译, 只关注重点部分, 部分内容加入了自己的理解.
索引和数据选取.
The axis labeling information in pandas objects serves many purposes:
轴标签信息在pandas
对象中有多个用途:
In this section, we will focus on the final point: namely, how to slice, dice, and generally get and set subsets of pandas objects. The primary focus will be on Series and DataFrame as they have received more development attention in this area.
在这部分中, 将着重讨论最后一点, 如何对pandas的对象进行切片获取其中的部分数据(即读写操作). 这是pandas
的开发优先关注的.
在使用pandas
进行处理数据时, 时不时会出现一个异常的警告(注意这不是错误)
C:\Users\Lian\AppData\Local\Temp/ipykernel_15272/2330773252.py:4: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead
See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy tmp['c'] = tmp['a'] + tmp['b']