python数据分析基础布朗利pdf_Python数据分析基础-(影印版)

Preface1. Python Basics   How to Create a Python Script   How to Run a Python Script   Useful Tips for Interacting with the Command Line   Pythons Basic Bui

Preface1. Python Basics How to Create a Python Script How to Run a Python Script Useful Tips for Interacting with the Command Line Pythons Basic Building Blocks Numbers Strings Regular Expressions and Pattern Matching Dates Lists Tuples Dictionaries Control Flow Reading a Text File Create a Text File Script and Input File in Same Location Modern File-Reading Syntax Reading Multiple Text Files with glob Create Another Text File Writing to a Text File Add Code to first_script.py Writing to a Comma-Separated Values (CSV) File print Statements Chapter Exercises2. Comma-Separated Values (CSV) Files Base Python Versus pandas Read and Write a CSV File (Part 1) How Basic String Parsing Can Fail Read and Write a CSV File (Part 2) Filter for Specific Rows Value in Row Meets a Condition Value in Row Is in a Set of Interest Value in Row Matches a Pattern/Regular Expression Select Specific Columns Column Index Values Column Headings Select Contiguous Rows Add a Header Row Reading Multiple CSV Fries Count Number of Files and Number of Rows and Columns in Each File Concatenate Data from Multiple Files Sum and Average a Set of Values per File Chapter Exercises3. Excel Files Introspecting an Excel Workbook Processing a Single Worksheet Read and Write an Excel File Filter for Specific Rows Select Specific Columns Reading All Worksheets in a Workbook Filter for Specific Rows Across All Worksheets Select Specific Columns Across All Worksheets Reading a Set of Worksheets in an Excel Workbook Filter for Specific Rows Across a Set of Worksheets Processing Multiple Workbooks Count Number of Workbooks and Rows and Columns in Each Workbook Concatenate Data from Multiple Workbooks Sum and Average Values per Workbook and Worksheet Chapter Exercises4. Databases Pythons Built-in sqlite3 Module Insert New Records into a Table Update Records in a Table MySQL Database Insert New Records into a Table Query a Table and Write Output to a CSV File Update Records in a Table Chapter Exercises5. Applications Find a Set of Items in a Large Collection of Files Calculate a Statistic for Any Number of Categories from Data in a CSV File Calculate Statistics for Any Number of Categories from Data in a Text File Chapter Exercises6. Figures and Plots matplotlib Bar Plot Histogram Line Plot Scatter Plot Box Plot pandas ggplot seaborn7. Descriptive Statistics and Modeling Datasets Wine Quality Customer Churn Wine Quality Descriptive Statistics Grouping, Histograms, and t-tests Pairwise Relationships and Correlation Linear Regression with Least-Squares Estimation Interpreting Coefficients Standardizing Independent Variables Making Predictions Customer Churn Logistic Regression Interpreting Coefficients Making Predictions8. Scheduling Scripts to Run Automatically Task Scheduler (Windows) The cron Utility (macOS and Unix) Crontab File: One-Time Set-up Adding Cron Jobs to the Crontab File9. Where to Go from Here Additional Standard Library Modules and Built-in Functions Python Standard Library (PSL): A Few More Standard Modules Built-in Functions Python Package Index (PyPI): Additional Add-in Modules NumPy SciPy Scikit-Learn A Few Additional Add-in Packages Additional Data Structures Stacks Queues Graphs Trees Where to Go from HereA. Download InstruaionsB. Answers to ExercisesBibliographyIndex

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
python数据分析基础教程》 ⼀、导⼊常⽤numpy模块 from numpy import * //可以直接引⽤numpy中的属性XXX import numpy as np //引⽤numpy中的属性⼀定要np.XXX ⼆、常⽤函数以及转化关系 np.arange() 对应 python中的range() np.array() 对应 python中的list np.dtype() 对应 python中的type() tolist()函数可以将numpy数组转换成python列表: 列表转为数组: warning:Passing 1d arrays as data is deprecated in 0.17 and willraise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample. 这个warning主要就是有些函数参数应该是输⼊数组,当输⼊列表时就会警告!! 三、numpy中数组操作函数 数组组合函数 将ndarray对象构成的元组作为参数输⼊ (1)⽔平组合:hstack((a,b)) 或者concatenate((a,b),axis=1) (2)垂直组合:vstack((a,b)) 或者concatenate((a,b),axis=0) (3)列组合:column((a,b)) (4)⾏组合:row_stack((a,b)) 数组的分割函数 (1)⽔平分割:hsplit(a,3) 或者 split(a,3,axis=1) (2)垂直分割:vsplit(a,3) 或者 split(a,3,axis=0) 四、⽂件处理——os库 1.os.system() 运⾏shell命令 2.os.listdir(path) 获得⽬录中的内容 3.os.mkdir(path) 创建⽬录 4.os.rmdir(path) 删除⽬录 5.os.isdir(path) os.isfile(path) 判断是否为⽬录或者⽂件 6.os.remove(path) 删除⽂件 7.os.rename(old, new) 重命名⽂件或者⽬录 8.os.name 输出字符串指⽰正在使⽤的平台。如果是window 则⽤'nt'表⽰,对于Linux/Unix⽤户,它是'posix' 9.os.path.join() 在⽬录后⾯接上⽂件名 10.os.path.split() 返回⼀个路径的⽬录名和⽂件名 11.os.path.splitext() 分离⽂件名与扩展名 12.os.path.getsize(name) 获得⽂件⼤⼩,如果name是⽬录返回0L 14.os.path.abspath(")获得当前路径 15.os.path.dirname()返回⼀个路径的⽬录名 五、使⽤matplotlib画图(第九章 ) 前⾯⼏个列⼦主要讲解了通过多项式函数通过plt.plot()函数构建绘图,补充⼀下在机器学习中散点绘制 import numpy as np import matplotlib.pyplot as plt fig=plt.figure() ax=fig.add_subplot(111) x1=[2, 2.6, 2.8] y1=[2, 2.4, 3] x2=[4,5 ,6] y2=[1.3, 2, 1.2] ax.scatter(x1,y1,s=20,c='red') ax.scatter(x2,y2,s=50,c='blue') plt.show() 另外:做数据分析——sklearn库 from sklearn import preprocessing 数据预处理:归⼀化、标准化、正则化处理 from sklearn import preprocessing preprocessing.normalize(features, norm='l2')//正则化

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值