Project:INTRODUCTION TO DATACAMP PROJECTS

Task 1: Instructions

Run the code cell below “1. This is a Jupyter Notebook!” by clicking the run cell button ( ▶| Run ) or hitting Ctrl + Enter. This will calculate how many children were born per day on average in 2016.

Then, click the Next Task button below.

# I'm a code cell, click me, then run me!
256 * 60 * 24 # Children × minutes × hours

368640

Task 2: Instructions

Replace the arguments to greet(‘James’, ‘Bond’) with your own name.

Run the code cell. (As this is part of every task we will drop this instruction from now on.)

def greet(first_name, last_name):
    greeting = 'My name is ' + last_name + ', ' + first_name + ' ' + last_name + '!'
    return greeting

# Replace with your first and last name.
# That is, unless your name is already James Bond.
greet('Daisy', 'Lee')

'My name is Lee, Daisy Lee!'

Task 3: Instructions

Read in the dataset datasets/global_temperature.csv and take a look at the first couple of rows

# Importing the pandas module
import pandas as pd

# Reading in the global temperature data
global_temp = pd.read_csv('datasets/global_temperature.csv')

# Take a look at the first datapoints
# ... YOUR CODE FOR TASK 3 ...
global_temp.head()

	year	degrees_celsius
0	1850	7.74
1	1851	8.09
2	1852	7.97
3	1853	7.93
4	1854	8.19

Task 4: Instructions

Add any suitable labels to the x-axis and y-axis of the plot.

# Setting up inline plotting using jupyter notebook "magic"
%matplotlib inline

import matplotlib.pyplot as plt

# Plotting global temperature in degrees celsius by year
plt.plot(global_temp['year'], global_temp['degrees_celsius'])

# Adding some nice labels 
plt.xlabel('year') 
plt.ylabel('degrees celsius') 

在这里插入图片描述

Task 5: Instructions

Replace the … in each label with the market share percentage for each smartphone company in companies.

# Making a map using the folium module
import folium
phone_map = folium.Map()

# Top three smart phone companies by market share in 2016
companies = [
    {'loc': [37.4970,  127.0266], 'label': 'Samsung: 20.5%'},
    {'loc': [37.3318, -122.0311], 'label': 'Apple: 14.4%'},
    {'loc': [22.5431,  114.0579], 'label': 'Huawei: 8.9%'}] 

# Adding markers to the map
for company in companies:
    marker = folium.Marker(location=company['loc'], popup=company['label'])
    marker.add_to(phone_map)

# The last object in the cell always gets shown in the notebook
phone_map

Task 6: Instructions

Are you ready to get started with DataCamp projects, True or False?

Check your project by clicking the Check Project button!

# Are you ready to get started with  DataCamp projects?
I_am_ready = True

# Ps. 
# Feel free to try out any other stuff in this notebook. 
# It's all yours!
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值