加载中...

存档 - 2020 年 05 月

7 篇文章

基于神经网络的降雨预测

😄 ## 😭 基于神经网络的降雨预测 占坑学习,以后再理解,脑壳痛! 源数据:tianjin.xlsx python 代码: import numpy as np import pandas as pd import sklearn filename = r'tianjin.xlsx' data = pd.read_excel(filename) pd.set_option('display.max_columns',None) # data.head() # data = data.drop('ET0',axis=1)#去除数据集中的ET0 data.head() # 读取前五行数据 len(data) len(data.columns) print(len(data.columns)) data = data.drop(['PMax','ET0', 'Rn', 'Wind', 'PMean', 'TMean', 'Delta','Gama'],axis = 1)#去除不需要的参数 print(data) #data = data.drop(['PMax', 'Wind', 'P....

daily leetcode - balanced-binary-tree - !

题目地址 https://leetcode.com/problems/balanced-binary-tree/ 题目描述 Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as: a binary tree in which the depth of the two subtrees of every node never differ by more than 1. Example 1: Given the following tree [3,9,20,null,null,15,7]: 3 / \ 9 20 / \ 15 7 Return true. Example 2: Given the following tree [1,2,2,3,3,null,null,4,4]: 1 / \ 2 2 / \ 3 3 / \ 4 4 Return false. 思路 求二叉树是否平衡,根据题目中的定....

daily leetcode - convert-sorted-list-to-binary-search-tree - !

题目地址 https://leetcode.com/problems/convert-sorted-list-to-binary-search-tree/ 题目描述 Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node never differ by more than 1. Example: Given the sorted linked list: [-10,-3,0,5,9], One possible answer is: [0,-3,9,-10,null,5], which represents the following height balanced BS....

daily leetcode - convert-sorted-array-to-binary-search-tree - !

题目地址 https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree/ 题目描述 Given an array where elements are sorted in ascending order, convert it to a height balanced BST. For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node never differ by more than 1. Example: Given the sorted array: [-10,-3,0,5,9], One possible answer is: [0,-3,9,-10,null,5], which represents the following height balanced BST: 0 / \ -3 9 / /....

daily leetcode - binary-tree-level-order-traversal-ii - !

题目地址 https://leetcode.com/problems/binary-tree-level-order-traversal-ii/ 题目描述 Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root). For example: Given binary tree {3,9,20,#,#,15,7}, 3 / \ 9 20 / \ 15 7 return its bottom-up level order traversal as: [ [15,7], [9,20], [3] ] 思路 从底部层序遍历其实还是从顶部开始遍历,只不过最后存储的方式有所改变,可以参见我之前的博文 Binary Tree Level Order Traversal 关键点解析 代码 解法一: class Solution { public: vector<v....

daily leetcode - construct-binary-tree-from-inorder-and-postorder-traversal - !

题目地址 https://leetcode.com/problems/construct-binary-tree-from-inorder-and-postorder-traversal/ 题目描述 Given inorder and postorder traversal of a tree, construct the binary tree. Note: You may assume that duplicates do not exist in the tree. 思路 这道题要求从中序和后序遍历的结果来重建原二叉树,我们知道中序的遍历顺序是左-根-右,后序的顺序是左-右-根,对于这种树的重建一般都是采用递归来做,可参见我之前的一篇博客Convert Sorted Array to Binary Search Tree 将有序数组转为二叉搜索树。针对这道题,由于后序的顺序的最后一个肯定是根,所以原二叉树的根节点可以知道,题目中给了一个很关键的条件就是树中没有相同元素,有了这个条件我们就可以在中序遍历中也定位出根节点的位置,并以根节点的位置将中序遍历拆分为左右两个部分,分别对其递....

搭建ssr,增强混淆协议,防止被Q

前言:上个月用 hostwinds 搭 ssr 来着,奈何也是经常被强,稍微百度了以下。原来在搭建 ssr 的时候选择的协议和混淆分别是:Original、Plain。 好像是这样的拼写吧。这都不重要,重要的是这样的协议和混淆容易被 GFW 检测到,以致封端口、IP。所以,万能的百度是无所不能的。😄 直接获取请直接移动至文末 注。 😋 重磅脚本 具体请见github:https://github.com/lonuslan/SSR.Go 如果你的 VPS 刚刚新装过系统,强烈建议你输入以下命令,重启并再次连接,否则安装的过程中,会出现各种各样未知的问题。 I really recommend you to restart your VPS when your installed system just now and you need to reconnect it manual in order to avoid lots of unknown mistakes. reboot 然后开始安装此工具(简体中文版)。 bash -c "$(curl -fsSL https://git....

avatar
Lonus Lan
It's better to burn out than to fade away!
公告
暂无更新通知!
最新文章
网站资讯
文章数目 :
156
已运行时间 :
0 天
本站在线访客数 :
0
本站总访问量 :
0