![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python入门
Lynne98
一个菜鸡
展开
-
数据分析笔试题
数据分析笔试题 数据: raw_data = {'platform': ['pcnews', 'pcnews', 'pcnews', 'pcnews', 'news', 'news', 'news', 'news', 'video', 'video', 'video', 'video'], 'order_num': ['1st', '1st', '2nd', '2nd', '1st', '1st', '2nd', '2nd','1st', '1st', '2nd', '2nd'],原创 2021-06-06 19:57:47 · 352 阅读 · 0 评论 -
Python中lambda的用法
a = lambda x,y,z:(x+8)*y-z print(a(5,6,8)) lambda匿名函数的格式: 冒号前是参数,可以有多个,用逗号隔开,冒号右边的为表达式。其实lambda返回值是一个函数的地址,也就是函数对象。 res = lambda 参数1,参数2,参数n:表达式 匿名函数lambda:是指一类无需定义标识符(函数名)的函数或子程序。 lambda 函数可以接收任意多个参数 (包括可选参数) 并且返回单个表达式的值。 ...原创 2021-06-06 19:55:07 · 150 阅读 · 0 评论 -
tf.expand_dims()用法详解
axis = x就是在第x维扩展,直接用例子来演示 current = np.array([ [0, 7, 1, 2, 2], [1, 7, 3, 4, 3], [2, 7, 5, 6, 6], [3, 7, 7, 8, 7], [4, 7, 7, 8, 7], [5, 7, 7, 8, 7] ]) current = array(current) current = tf.constant(current) points_e0 = tf.expand_d原创 2021-04-14 17:31:22 · 458 阅读 · 0 评论 -
Keras搭建CNN模型基础
Keras神经网络基础 导包 import tensorflow as tf from tensorflow.keras.layers import Dense from tensorflow.keras import Model from sklearn import datasets import numpy as np 神经网络基础结构: 模型搭建&实例化 class 网名(Model): def init(self): super(网名, self).init() self.原创 2021-01-19 17:08:04 · 630 阅读 · 0 评论 -
Python入门————02 (未完)
1 列表 列表通常包含多个元素,用方括号[] 来表示列表 可以对列表元素调用字符串的操作方法 string = ['abc','bcd','cde','def'] print(string[0]) >>> abc print(string[1].title()) >>> Bcd 1.1访问列表 索引从0开始, 如指定返回-1 则是返回最后...原创 2020-01-02 21:29:14 · 80 阅读 · 0 评论 -
Python入门————01 字符串&数字
1、字符串 用引号括起的都是字符串,其中引号可以是单引or双引 这种灵活的方式可以让字符串中包含引号 1.1 使用方法修改字符串大小写 1.1.1 title() 以首字母大写的方式显示每个单词(将每个单词首字母都改成大写) name="ada lovelace" print(name.title()) #输出:Ada Lovelace 1.1.2 字符串全部改为大写...原创 2020-01-02 21:22:03 · 170 阅读 · 0 评论 -
Python入门笔记(一)
# -*- coding: UTF-8 -*- print "hello world" # ====多行语句==== sums = 1 + \ 2 + \ 3 print(sums) days = ['monday', 'Tuesday', 'Monday'] print(days) # =====等待用户输入====== # raw_input("按下...原创 2018-07-11 12:35:15 · 307 阅读 · 0 评论 -
Python学习笔记(二)
# -*- coding: UTF-8 -*- print "============数字============" import cmath var1 = 1 del var1 # 删除了对象的引用,相当于取消了对var1的定义。如果这里不重新赋值的话,就会报错。 var1 = 3 print(var1) print "============字符串==============" strs ...原创 2018-07-12 11:35:36 · 152 阅读 · 0 评论 -
爬虫
import requests # 这里必须在cmd里pip install requests一下,不然会报错 import re import random r = requests.get("http://www.baidu.com") print(r.status_code) # 访问状态码,如果是200表示访问成功 print(r.encoding) # 从header中猜测的响应...原创 2018-08-02 10:15:31 · 148 阅读 · 0 评论