自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 mac下安装R和Rstudio

1.尝试1一开始尝试用anaconda安装,在终端中conda install R但是在anaconda中点Rstudio的install一直安装不上。2.尝试2R的下载路径:https://cran.r-project.org/RStudio的下载路径:https://www.rstudio.com/products/rstudio/download/利用这两个路径,先安装R,再安...

2020-02-22 13:23:42 2604

原创 python numpy函数:rand&randn

numpy.random.randn(d0, d1, …, dn)是从标准正态分布中返回一个或多个样本值。numpy.random.rand(d0, d1, …, dn)的随机样本位于[0, 1)中。用法:import numpy as npa=np.random.randn(2,3)#产生m行n列的矩阵print(a)输出:...

2020-02-13 11:02:02 653

原创 python numpy函数:zeros()

参数:zeros(shape,dtype=float,order='C')#返回一个给定形状和类型的用0填充的数组1.创建一位数组zeros(参数)2.创建其他类型的一位数组(默认类型是浮点)3.创建多维数组括号里面[行数,列数],要改变类型在后面加上类型即可...

2020-02-12 19:17:05 607

原创 Neural Networks and Deep Learning_week 2_1

Logistic Regression as a Neural Network1.Binary Classification** binary classification定义**其中n为向量的纬度nations2.logistic Regression(逻辑回归是一种学习算法?)3.logistic Regression Cost Functioncost functio...

2020-02-12 16:55:46 113

原创 NeuralNetwork and DeepLearning_week1

welcomethings to learnintroduce to deep learningwhat is a neural networkReLU function线性整流函数(Rectified Linerar Unite)=> max(0,y)supervised learning with Neural Networks1.CNN:卷积神经网络,经常用于图像数据...

2020-02-09 15:34:49 137

原创 leetcode349

语法//find函数的用法//注意vector是没有find函数的,必须调用头文件algorithm#include <iostream>#include <algorithm>#include <vector> int main(){ using namespace std; vector<int> vec; ...

2020-02-08 14:33:22 200

原创 2_chapter10

Tuples1.tuples are like lists2.but tuples are immutablestring and tuples are immutable3.things not to do with tuples4. 利用tuples直接赋值5.dictionary的每一对,(key,value)就是一个tuples结构如果直接打印dictionary.i...

2020-02-08 10:08:08 98

原创 2_chapter9

9.1 DictionariesList像筒装薯片,像书架Dictionary像一个大包,什么都能往里面仍,需要lable1.创建dictionary a=dict()2. 用{ }创建dictionary9.2 Counting with Dictionaries1.利用dictionaries进行数数2.检测某个key是否在dictionary里除了一条一条检测,也可以...

2020-02-07 16:41:19 106

原创 leetcode441

思路找规律:1.顺着想:class Solution {public: int arrangeCoins(int n) { int result; int item=1;//每一层末尾的数 int i=2;//层数 if(n==1) return 1; while(true){ ...

2020-02-07 14:52:49 87

原创 2_chapter8_list

8.1 Listsa list element can be any python object: even another listlists are mutable but strings are notthe length of list:(注意C++里面用的是size)range function8.2 Manipulating ListsConcatenating Li...

2020-02-07 11:19:30 89

原创 leetcode989

Add to Array-Form of Integer思路感觉和之前做的加法问题差不多class Solution {public: vector<int> addToArrayForm(vector<int>& A, int K) { vector<int> result; int a=A.size(...

2020-02-06 14:21:37 146 1

原创 2_chapter7

7.1 filesgrammeropen a file:\n: new line character注:a text file has newlines at the end of each lineProcessing filesgrammercount lines文件名.read():读出文件中有多少个字节文件也可以用函数startswith()进行查找:如果文件每...

2020-02-06 11:20:52 83

原创 leetcode415

思路1.感觉和之前做过的二进制的相加很像(补齐高位从后往前一位一位加,单独讨论最高位),只不过这次是10进制而已。直接用二进制的方法来做,发现程序报了错。代码:class Solution {public: string addStrings(string num1, string num2) { int num1_len=num1.size(); ...

2020-02-05 22:19:19 194

原创 2_chapter6

**Chapter 6: strings **

2020-02-04 16:18:52 140

原创 leetcode258

add digits报错Line 14: Char 20: runtime error: signed integer overflow: 2147483640 + 8 cannot be represented in type ‘int’ (solution.cpp)public: int addDigits(int num) { int sum=0; ...

2020-02-04 14:49:48 354

原创 python learning_1

programming for everybody - python第二章1.一些语法打印函数:print(x)reminder:%9/2:在python3中输出4.5而不是4,4 是python2power:** (4**3的意思是444)type(x):输出x的类型float(99)和int(‘123’):将整数99转换为浮点型input():可以从对话框中接东西进来#:...

2020-02-04 11:14:46 114

原创 leetcode67

Add Binary思路自己愚蠢的思路:暴力进制转换,利用十进制相加后再次进行转换大佬:

2020-02-03 15:54:17 195

原创 leetcode7

7. Reverse Integer总体思路:一位数一位数地从个位拆除其他判断:注意考虑整数溢出的情况1.C++注意点:在头文件limits.h中,最大值用INT_MAX,最小值用INT_MINclass Solution {public: int reverse(int x) { int pop; int ans=0; whil...

2020-02-03 09:26:16 90

原创 leetcode717

717. 1-bit and 2-bit Characters分析:1bit的字符只有0一个,而2bit的字符有10和11两种,题目需要判断一个字符串的最后一个0属于1bit的字符,还是2bit字符中的10.出现问题control reaches end of non-void function它的意思是:控制到达非void函数的结尾。就是说一些本应带有返回值的函数到达结尾后可能并没有...

2020-02-03 09:24:58 138

原创 window10下安装scipy

window10下安装scipy一、问题所在二、解决办法一、问题所在之前电脑里面已经安装过numpy,直接用pip install scipy时,出现了以下错误二、解决办法1、从https://www.lfd.uci.edu/~gohlke/pythonlibs/网址下载scipy,(在这里原本下载了64位的包,但是下载的python是32位的,所以还是下载了32位的。)2、下载完...

2019-07-16 14:51:08 1390 2

转载 测验1: Python基本语法元素 (第1周)

一、单选题1‪‬‪‬‪‬‪‬‪‬‮‬‪‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‮‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‮‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‮‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‮‬‪‬‪‬‪‬‪‬‪‬Guido van Rossum正式对外发布Python版本的年份是:‪‬‪‬‪‬‪‬‪‬‮‬‪‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‮‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‮‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‮‬‪‬‪...

2019-07-16 14:49:34 326

空空如也

空空如也

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

TA关注的人

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