
利用python做数据分析
书(代码手敲)
cutwind
白身红尘客/风起水无波/仗剑欲饮酒/看人间不朽
qq:1246467060(加Q备注优快云)
展开
-
python|LightGBM模型
# -*- coding: utf-8 -*- """ Created on Fri Jun 12 16:20:17 2020 @author: weiping """ import xgboost as xgb import lightgbm as lgb from sklearn.model_selection import train_test_split from sklearn.metrics import * from sklearn.datasets import load_iri.原创 2020-06-15 15:36:49 · 4152 阅读 · 0 评论 -
利用python进行数据分析matplotlib_api入门
# -*- coding: utf-8 -*- """ Created on Tue Oct 29 09:27:37 2019 @author: weiping """ import matplotlib.pyplot as plt import numpy as np import pandas as pd plt.plot(np.arange(10)) plt.show() fig,...原创 2019-10-29 10:54:08 · 232 阅读 · 0 评论 -
利用python进行数据分析pandas_字符串
# -*- coding: utf-8 -*- """ Created on Mon Oct 28 17:30:22 2019 @author: weiping """ val = 'a,b , gudd , tt' val.split(',') pp = [x.strip() for x in val.split(',')] pp ''' 字符串连接 ''' a,b,c,d = pp ...原创 2019-10-28 19:14:41 · 242 阅读 · 0 评论 -
利用python进行数据分析pandas_数据转换
# -*- coding: utf-8 -*- """ Created on Mon Oct 28 14:26:56 2019 @author: weiping """ import pandas as pd import numpy as np df = pd.DataFrame({'k1':['a']*3 + ['b']*4, 'k2':[2,2,...原创 2019-10-28 17:29:31 · 302 阅读 · 0 评论 -
利用python进行数据分析pandas_数据重排
# -*- coding: utf-8 -*- """ Created on Fri Oct 25 16:41:03 2019 @author: weiping """ import pandas as pd import numpy as np df1 = pd.DataFrame({'name':['a','b','c','d','f','g'], ...原创 2019-10-28 14:13:39 · 564 阅读 · 0 评论 -
利用python进行数据分析pandas_DataFrame1
# -*- coding: utf-8 -*- """ Created on Thu Oct 24 17:03:08 2019 @author: weiping """ import pandas as pd import numpy as np data = np.array([[1,3,5,7], ['a','b','c','d'], [2001,2002...原创 2019-10-24 20:12:30 · 302 阅读 · 0 评论 -
利用python进行数据分析pandas_Series
# -*- coding: utf-8 -*- """ Created on Thu Oct 24 11:18:32 2019 @author: weiping """ import pandas as pd ''' Series ''' ser = pd.Series([3,5,-6,9]) ser ser.values #series 的数据值 ser.index #series的索引...原创 2019-10-24 13:55:52 · 241 阅读 · 0 评论 -
利用python做数据分析--numpy模块
# -*- coding: utf-8 -*- """ Created on Mon Oct 21 09:59:52 2019 @author: weiping """ import numpy as np ''' 一维数组 ''' data = [3,5,7,9] data*10 ## 结果是复制data10遍 data_n = np.array(data) data_n*10...原创 2019-10-23 16:05:58 · 190 阅读 · 0 评论