class Pointer(object): def __init__(self, x: float, y: float): self.x = x self.y = y class Circle(object): def __init__(self, cp: Pointer, r: float): self.cp = cp self.r = r def c_area(self): print(math.pi * (self.r ** 2)) def c_long(self): print(2 * math.pi * self.r) def p_relationship(self, point: Pointer): if abs(point.x - self.cp.x) ** 2 + abs(point.y - self.cp.y) ** 2 == self.r ** 2: print('该点在圆上') elif abs(point.x - self.cp.x) ** 2 + abs(point.y - self.cp.y) ** 2 < self.r ** 2: print('该点在圆内') elif abs(point.x - self.cp.x) ** 2 + abs(point.y - self.cp.y) ** 2 > self.r ** 2: print('该点在圆外') cp=Pointer(2,3) circle=Circle(cp,5) circle.c_area() circle.c_long() p1=Pointer(3,4) p2=Pointer(1,2) circle.p_relationship(p1) circle.p_relationship(p2)
R for Data Science: Import, Tidy, Transform, Visualize, and Model Data ISBN: 1491910399 | 2017 | True PDF | 522 pages | 32 MB What exactly is data science? With this book, you’ll gain a clear understanding of this discipline for discovering natural laws in the structure of data. Along the way, you’ll learn how to use the versatile R programming language for data analysis. Whenever you measure the same thing twice, you get two results—as long as you measure precisely enough. This phenomenon creates uncertainty and opportunity. Author Garrett Grolemund, Master Instructor at RStudio, shows you how data science can help you work with the uncertainty and capture the opportunities. You’ll learn about: Data Wrangling—how to manipulate datasets to reveal new information Data Visualization—how to create graphs and other visualizations Exploratory Data Analysis—how to find evidence of relationships in your measurements Modelling—how to derive insights and predictions from your data Inference—how to avoid being fooled by data analyses that cannot provide foolproof results Through the course of the book, you’ll also learn about the statistical worldview, a way of seeing the world that permits understanding in the face of uncertainty, and simplicity in the face of complexity.
©️2020 CSDN 皮肤主题: 游动-白 设计师:白松林 返回首页