加载中
使用观察者模式监督任务执行

package com.test; import java.util.Observable; /** * 该死的执行器,经常性罢工 * @author w.s * */ public class DeadWorker extends Observable implements Runnable { //最新工作进度 ...

MySQL批量修改数据表和数据表中所有字段的字符集

SELECT CONCAT( 'ALTER TABLE ', TABLE_NAME, ' CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;' ) FROM information_schema.TABLES WHERE TABLE_SCHEMA = 'DATABASE_NAME';...

2020/12/12 10:03
90
pandas操作excel操作-20-操作数据库-复杂函数的使用

读取数据库 import pandas as pd import pyodbc import sqlalchemy connection = pyodbc.connect('{driver_url}') engine = sqlalchemy.create_engine('{driver_url}') query_sql = 'select ...

2020/03/01 22:35
267
pandas操作excel操作-19-常用数据操作

常用数据操作 students01 = pd.read_excel('C:/students.xlsx', index_col='ID', sheet_name='page01') students02 = pd.read_excel('C:/students.xlsx', index_col='ID', sheet_name='page0...

2020/03/01 22:16
199
pandas操作excel操作-18-按数据值效果显示及数据操作

使用jupyter 根据数据值,背景展示深浅不同 import pandas as pd import seaborn as sns color_map = sns.light_palette('green', as_cmap=True) students = pd.read_excel('C:/students.xls...

2020/03/01 21:57
231
pandas操作excel-17-数据统计-数据条件变色

按照年度分析销售数据 import pandas as pd import numpy as np pd.options.display.max_columns = 1000 orders = pd.read_excel('C:/Orders.xlsx') orders['Year'] = pd.DatetimeIndex(orde...

2020/03/01 21:28
541
pandas操作excel-16-数据处理

拆分单元格内容 import pandas as pd employees = pd.read_excel('C:/employee.xlsx') df = employees['Full Name'].str.split(n=2, expand=True) employees['First Name'] = df[0] employee...

2020/03/01 20:47
268
pandas操作excel-15-数据校验

import pandas as pd def score_validation(row): try: assert 0<=row.Score<=100 except: print(f'Idx: {row.idx} StudentName: {row.Name} has an invalid score: {row.Score}') 索......

2020/02/29 17:51
603
pandas操作excel-14-dataFrame-merge/join

输出各列之间的相关性: import pandas as pd homes = pd.read_excel('D:/output.xlsx', index_col='idx') 输出各列之间的相关性 print(homes.corr()) dataFrame-merge/join: import pandas ...

2020/02/29 17:29
223
pandas操作excel-13-散点图-密度图-直方图

import pandas as pd import matplotlib.pyplot as plt 将所有列的数据都显示出来 pd.options.display.max_columns = 1000 homes = pd.read_excel('D:/output.xlsx', index_col='Name') prin...

2020/02/29 16:25
317
pandas操作excel-12-折线图-叠加区域图

import pandas as pd import matplotlib.pyplot as plt users = pd.read_excel('D:/output.xlsx', index_col='idx') 绘制折线图 #users.plot(y=['M2018', 'M2019', 'M2020']) 绘制叠加区域图...

2020/02/29 16:07
696
pandas操作excel-11-饼图

import pandas as pd import matplotlib.pyplot as plt users = pd.read_excel('D:/output.xlsx', index_col='Name') 饼图 users['M2018'].sort_values(ascending=True).plot.pie(fontsize=8...

2020/02/29 15:36
493
pandas操作excel-10-叠加柱状图

import pandas as pd import matplotlib.pyplot as plt users = pd.read_excel('D:/output.xlsx', index_col='idx') users['Total'] = users['M2018'] + users['M2019'] + users['M2020'] us...

2020/02/29 15:24
310
pandas操作excel-09-分组柱状图

import pandas as pd import matplotlib.pyplot as plt students = pd.read_excel('D:/output.xlsx', index_col='idx') students.sort_values(by='M2019', inplace=True, ascending=True) pr...

2020/02/29 15:10
396
pandas操作excel-08-简单绘图-柱状图

import pandas as pd import matplotlib.pyplot as plt students = pd.read_excel('D:/output.xlsx', index_col='idx') students.sort_values(by='SinglePrice', inplace=True, ascending=Fa...

2020/02/29 14:25
268
pandas操作excel-07-数据筛选

import pandas as pd def age_18_to_30(a): return 18 <= a < 30 def level_a(s): return 85 <= s <= 100 students = pd.read_excel('D:/output.xlsx', index_col='idx') 筛选出 年龄在18到3...

2020/02/29 14:03
257
pandas操作excel操作-06-数据排序操作

import pandas as pd books = pd.read_excel('D:/output.xlsx', index_col='idx') 按照SinglePrice排序 books.sort_values(by='SinglePrice', inplace=True, ascending=False) 按照TotalMone...

2020/02/29 13:35
285
pandas操作excel操作-05-批量数据操作

import pandas as pd def add_2(x): return x+2 books = pd.read_excel('D:/output.xlsx', index_col='idx') 列之间的数值计算1 books['TotalMoney'] = books['SinglePrice'] * 0.8 列之间的...

2020/02/29 13:26
370
pandas操作excel操作-04-数据填充

import pandas as pd from datetime import date, timedelta skiprows 跳过前面的多少行 usecols 读取excel中选中的列 index_col 使用作为索引列的列名 dtype 根据列名,设置列的数据类型 bo...

2020/02/29 12:50
419
pandas操作excel操作-03-数据整理(Series加入DataFrame)

创建Series方式1 定义字典 d = {'x':100, 'y':200, 'z':300} 字典的键的集合 print(d.keys()) 字典的值的结合 print(d.values()) 使用键获取值 print(d['x']) 在pandas 中,行和列都可以使用...

2020/02/29 12:02
401

没有更多内容

加载失败,请刷新页面

返回顶部
顶部