![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python使用_pandas
文章平均质量分 70
Alex.Deng
con - confidence
resT - not restrain, willing to give up, price of the dream
D - diligence
舍得,代价
展开
-
python使用_pandas_文本字符串处理
1. 字符串处理1.1 对某列的所有字符串计算长度(len)1.2 拆分字符串,并将结果分列展示1.3 去除空格、换行符、字符串'\xa0'等1.4 需要多个分隔符对字符串进行切分通过示例代码实现上述功能:构造示例数据:#!/usr/bin/python3# -*- coding: utf-8 -*-import pandas as pdimport ...原创 2018-12-11 20:21:47 · 874 阅读 · 0 评论 -
python使用_pandas_用stack和unstack进行行列重塑(key-value变宽表)
数据结构的重塑(reshape)与数据库交互时常遇到堆叠格式(key-value)和宽表形式(dataframe)的转换,如:堆叠格式:宽表形式dataframe:下面是相互转换的示例代码:import pandas as pdimport numpy as np# 常用的表格形式的数据结构df = pd.DataFrame(np.arange(6).re...原创 2019-02-16 11:14:24 · 1540 阅读 · 0 评论