自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(14)
  • 收藏
  • 关注

原创 [Python Crash Course] Alien

Basic Structure # import sys # exit the gameimport pygamefrom setting import Settingsfrom ship import Shipimport game_functions as gffrom pygame.sprite import Group # manage bulletsdef...

2020-08-02 10:43:02 161

原创 [Python Crash Course] API

import requests # APIimport pygal # visualizationfrom pygal.style import LightColorizedStyle as LCS, LightenStyle as LS# make an API call and store the response #url = 'https://api.

2020-08-02 10:27:48 147

原创 [Python Crash Course] DataVisual_GlobalData

import jsonfrom pygal_maps_world.i18n import COUNTRIES # i18n: internationalization / contains two-letter namesimport pygal_maps_world.maps # figure mapsfrom pygal.style import RotateStyle # style mapsfrom pygal.style imp.

2020-08-02 10:19:25 101

原创 [Python Crash Course] DataVisual_RollDice

from random import randintclass Die: """ represent a single die """ def __init__(self, num_side=6): # D6: a die with 6 sides self.num_side = num_side def roll(self): return randint(1, self.num_side) # randint[mi.

2020-08-01 14:18:27 166

原创 [Python Crash Course] DataVisual_RandomWalk

from random import choice""" *This file is about to generate (num_points) points in one figure randomly. *three attribute: 1.variable: the number of points 2.lists: x- and y-coordinate values of each point"""class RandomWalk: """gen.

2020-08-01 14:15:50 103

原创 [Python Crash Course] DataVisual_Basic

import matplotlib.pyplot as plt# change feature #plt.title("Square Numbers", fontsize=24) # fontsize: size of the textplt.xlabel("x_value", fontsize=14)plt.ylabel("y_value", fontsize=14)# set the range #plt.axis([0, 100, 0, 100]) .

2020-08-01 14:12:59 99

原创 [Python Crash Course] Basics_Import

# import project #import AboutFunctionlist_3 = ['with', 'hope']print("import project:")AboutFunction.function_2(list_3)# import function #from AboutFunction import function_1print("import function:")function_1(list_3)# change name #from AboutF.

2020-08-01 11:25:08 104

原创 [Python Crash Course] Basics_File

# import text #with open('pi.txt') as file_object: # search the same directory // 'text_files\pi.txt':relative path print("all content:") content = file_object.read() # python will close the file automatically print(content)with .

2020-08-01 11:20:18 62

原创 [Python Crash Course] Basics_Class

class Dog: def __init__(self, name, age): self.name = name self.age = age self.weight = 10 self.height = 0 def sit(self): print(self.name + " is sitting.") def sleep(self): print(self.name + " .

2020-08-01 11:15:25 97

原创 [Python Crash Course] Basics_Function

# list作参数 #list_1 = ['a', 'b']def function_1(list_2): print(list_2) passfunction_1(list_1[:]) # [:]传递副本,函数操作不会改变原list# Arbitrary Number of Arguments -> list #def function_2(*name): print(name)print("Arbitrary Number of Argum.

2020-08-01 10:54:14 84

原创 [Python Crash Course] Bisics_While

# simple message #message = input("input something:")print("hello " + message)# numerical #age = input("input your age:")age = int(age) # int()if age > 18: print("adult")else: print("child")# 循环输入 #print("while Input:")messag.

2020-08-01 10:40:50 67

原创 [Python Crash Course] Bisics_Type of Data

# About String #name = "this is a string."print("name:", name)# 输出格式 #print("title():", name.title()) # 以标题形式输出,首字母大写print("upper():", name.upper()) # 全大写print("lower():", name.lower()) # 全小写# 字符串连接 #print(name + " this is the additional .

2020-08-01 10:36:51 161

原创 [US Baby Names]Error:‘year‘ is both an index level and a column label, which is ambiguous.

ERROR:[pivot table] : 'some' is both an index and a column label.SOLVE:pandas.Series.dropleveltotal_births_advance = top_1000_plot.pivot_table('births', index='year', columns='name', aggfunc=sum)[year]同时是index和column,出现矛盾。打印top_1000,长这..

2020-07-11 10:59:02 5364 1

原创 [python学习备忘录]window导入scrapy报错

点击Install package scrapy安装scrapy包,报错:在cmd中输入命令:pip install scrapy报错;提示pip版本过低:复制命令'python -m pip install --upgrade pip',运行升级,提示successful成功:下载适配版本Twisted:https://pypi.org/project/Twisted/#files,提示成功:Twisted-20.3.0-cp<python版本>-...

2020-06-04 11:00:58 194

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除