- 博客(67)
- 资源 (1)
- 收藏
- 关注
原创 大语言模型下载,huggingface和modelscope加速,不用翻墙
大模型下载速度较快的方式,huggingface,modelscope
2024-01-12 18:17:04 3619
原创 pandas数据分析,matplotlib绘图(折线图),图片和数据批量写入excel
pandas数据分析,绘制折线图,批量写入数据和图片到excel,matplotlib折线图绘制封装
2023-03-27 19:49:34 1365
原创 pandas写入excel报错 ‘Workbook‘ object has no attribute ‘sheetnames‘
我在jupyter notebook同样的代码能正常写入excel并成功写入图片,但在pycharm老是报错,我核对了虚拟环境和pandas的包,确定是在同一个虚拟环境,pandas的包都是一样的,但就是一直报错,为此我查了几个小时,一晚上都没解决,周一来上班,我又继续尝试,没想到一个小时我就解决了,居然只需要加一个参数。
2023-03-27 11:04:00 2519
原创 CentOS下 ImportError: libGL.so.1: cannot open shared object file
Centos下报错ImportError: libGL.so.1: cannot open shared object file。
2023-03-15 21:57:53 1158
原创 datetime计算时间差(小时)
因为datetime计算时间差,只有 seconds, days,没有hours,于是,我就利用 seconds / 3600,来计算hours,但是出现了错误的结果(new_time - old_time).seconds(new_time - old_time).daysdatetime计算hours案例from datetime import datetimedef calc_hours(old): old_time = datetime.strptime(old, "%Y-%m-
2020-11-21 22:58:01 8432 1
原创 安装pyHive报错
安装pyhive还需要安装其他依赖包pip install saslpip install thriftpip install thrift-saslpip install PyHive安装sasl遇到的问题Collecting sasl Using cached https://files.pythonhosted.org/packages/8e/2c/45dae93d666aea8492678499e0999269b4e55f1829b1e4de5b8204706ad9/sasl-0.
2020-11-10 11:08:59 955
原创 【Leetcode】198. House Robber
198. House RobberYou are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is t...
2020-04-15 14:38:36 386
原创 【Leetcode】152. Maximum Product Subarray
152. Maximum Product SubarrayGiven an integer array nums, find the contiguous subarray within an array (containing at least one number) which has the largest product.Example 1:Input: [2,3,-2,4]Out...
2020-04-15 14:38:29 290
原创 【Leetcode】628. Maximum Product of Three Numbers
628. Maximum Product of Three NumbersGiven an integer array, find three numbers whose product is maximum and output the maximum product.Example 1:Input: [1,2,3]Output: 6Example 2:Input: [1,2,3,...
2020-04-15 14:38:22 321
原创 【Leetcode】53. Maximum Subarray
53. Maximum SubarrayGiven an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum.Example:Input: [-2,1,-3,4,-1,2,1,-5,4],O...
2020-04-15 14:38:10 222
原创 【Leetcode】156. Merge Intervals
156. Merge IntervalsDescriptionGiven a collection of intervals, merge all overlapping intervals.ExampleGiven intervals => merged intervals:[ [ (1, 3), (1, 6...
2020-04-15 14:37:44 419
原创 【Leetocde】5. Longest Palindromic Substring
题目给定一个字符串 s,在 s 中找到最长的回文子串,s 的最大长度是 1000。题目难度:中等描述MediumGiven a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.Example 1:Input: "baba...
2020-04-15 14:37:31 136
原创 【Leetcode】1108. Defanging an IP Address
1108. Defanging an IP AddressEasy183503ShareGiven a valid (IPv4) IP address, return a defanged version of that IP address.A defanged IP address replaces every period "." with "[.]".Example 1:Inp...
2020-04-15 14:37:21 175
原创 【Leetcode】459. Repeated Substring Pattern
459. Repeated Substring PatternEasyGiven a non-empty string check if it can be constructed by taking a substring of it and appending multiple copies of the substring together. You may assume the giv...
2020-04-15 14:37:12 168
原创 【Leetcode】657. Robot Return to Origin
657. Robot Return to OriginEasyThere is a robot starting at position (0, 0), the origin, on a 2D plane. Given a sequence of its moves, judge if this robot ends up at (0, 0) after it completes its mo...
2020-04-15 14:36:34 156
原创 【Leetcode】557. Reverse Words in a String III
557. Reverse Words in a String IIIEasyGiven a string, you need to reverse the order of characters in each word within a sentence while still preserving whitespace and initial word order.Example 1:...
2020-04-15 14:36:23 288
原创 【Leetcode】541. Reverse String II
541. Reverse String IIEasyGiven a string and an integer k, you need to reverse the first k characters for every 2k characters counting from the start of the string. If there are less than k characte...
2020-04-15 14:36:16 231
原创 【Leetcode】344. Reverse String
344. Reverse StringEasyWrite a function that reverses a string. The input string is given as an array of characters char[].Do not allocate extra space for another array, you must do this by **modif...
2020-04-15 14:36:09 167
原创 Java高并发(二) - Java 内存模型与线程
Java高并发(一)- 并发编程的几个基本概念Java高并发(二) - Java 内存模型与线程Java高并发(三) - CountDownLatch、CyclicBarrier和SemaphoreJava高并发(四) - Java 原子类详解Java高并发(五) - 线程安全策略Java高并发(六) - 锁的优化及 JVM 对锁优化所做的努力一. 硬件的效率一致性引入高速缓存...
2020-04-15 14:36:01 240
原创 Java高并发(一)- 并发编程的几个基本概念
Java高并发(一)- 并发编程的几个基本概念Java高并发(二) - Java 内存模型与线程Java高并发(三) - CountDownLatch、CyclicBarrier和SemaphoreJava高并发(四) - Java 原子类详解Java高并发(五) - 线程安全策略Java高并发(六) - 锁的优化及 JVM 对锁优化所做的努力同步(synchronous)和异步(A...
2020-04-14 09:55:48 308
原创 【Leetcode】1221. Split a String in Balanced Strings
1221. Split a String in Balanced StringsEasyBalanced strings are those who have equal quantity of ‘L’ and ‘R’ characters.Given a balanced string s split it in the maximum amount of balanced strings...
2020-04-14 09:48:37 185
原创 【Leetcode】686. Repeated String Match
686. Repeated String MatchEasyGiven two strings A and B, find the minimum number of times A has to be repeated such that B is a substring of it. If no such solution, return -1.For example, with A =...
2020-04-14 09:48:01 143
原创 【Leetcode】26. Remove Duplicates from Sorted Array
##【Leetcode】26. Remove Duplicates from Sorted Array26.Remove Duplicates from Sorted Array](https://leetcode.com/problems/remove-duplicates-from-sorted-array/)EasyGiven a sorted array nums, remove t...
2020-04-14 09:44:05 204
原创 【Leetcode】213. House Robber II
213. House Robber IIYou are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed. All houses at this place are arranged in a circle. That mean...
2020-04-14 09:41:19 249
原创 【Leetcode】62. Search in Rotated Sorted Array
62. Search in Rotated Sorted ArrayYou are given a target value to search. If found in the array return its index, otherwise return -1.You may assume no duplicate exists in the array.ExampleFor [4,...
2020-04-14 09:40:16 136
原创 【Leetcode】100. Remove Duplicates from Sorted Array
100. Remove Duplicates from Sorted ArrayDescriptionGiven a sorted array, remove the duplicates in place such that each element appear only once and return the new length.Do not allocate extra space...
2020-04-14 09:39:44 198
原创 【Leetcode】479. Second Max of Array
479. Second Max of ArrayFind the second max number in a given array.NoticeYou can assume the array contains at least two numbers.ExampleGiven [1, 3, 2, 4], return 3.Given [1, 2], return 1.思路:从数...
2020-04-14 09:39:13 166
原创 【Leetcode】88. Merge Sorted Array
88. Merge Sorted ArrayGiven two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.Note:The number of elements initialized in nums1 and nums2 are m and n respectivel...
2020-04-14 09:38:42 112
原创 【Leetcode】128. Longest Consecutive Sequence
Given an unsorted array of integers, find the length of the longest consecutive elements sequence.Your algorithm should run in O(n) complexity.Example:Input: [100, 4, 200, 1, 3, 2]Output: 4Explan...
2020-04-14 09:38:03 127
原创 【LeetCode】849. Maximize Distance to Closest Person
【LeetCode】849. Maximize Distance to Closest Person849. Maximize Distance to Closest PersonEasyIn a row of seats, 1 represents a person sitting in that seat, and 0 represents that the seat is empty....
2020-04-14 09:37:30 199
原创 通俗讲解决策树:如何利用有效特征进行决策分类?
决策树 (Decision Tree) 是一种有监督学习方法,通过特征和标签构造一棵决策树,学习特征之间的规则,以解决分类和回归问题。使用决策树进行决策的过程就是从根节点开始,测试待分类项中相应的特征属性,并按照其值选择输出分支,直到到达叶子节点,将叶子节点存放的类别作为决策结果。决策树由以下 3 种元素构成:根节点:包含样本全集内部节点:对应特征属性测试叶节点:决策结果 (标签)...
2020-04-11 14:49:18 2187
原创 诈骗团伙冒充京东金融客服来注销账号,25岁职场小伙3次转账超过3万,累计被骗14万,警方立案在线等结果,急......
今天,也就是 4 月 7 日,发生在我身边一件大事,和我同一部门的同事被一名冒充京东金融的诈骗团伙累计诈骗 14 万。平日里看到诈骗,我都是一概忽略,如今发生在身边,不得不引起我的关注,也让一直在更文的我,想要曝光这次事件,一来,希望能引起媒体重视,有一些舆论压力,警方能更快破案,同事也能安心一些。二来,诈骗案件我在网上看到类似的有很多,想着作为自媒体人,也要尽自己的一份力量,传播出去,让更多的...
2020-04-08 03:01:07 42256 21
原创 超详细白板推导:从模型和优化 2 个角度详解 SVM 核函数
在 SVM 白板推导| 由最大间隔化目标演化的损失函数推导过程 中白板手推了 SVM 的原理,并介绍了硬间隔核函数的实现原理及公式推导,这一节我来详细介绍下 SVM 中的 Keynel Function。一直以来我们只知道核函数能让 SVM 在高维空间中实现非线性可分,那么,核函数是在什么情况下被提出的呢?又有哪几种核函数呢?本篇文章从 2 个角度讲解 SVM 核函数。非线性带来高维转换...
2020-04-06 17:04:53 625
原创 PLA:从线性可分到线性不可分的演化过程
从线性可分到线性不可分PLA 从线性可分到线性不可分,有 3 种不同的形态。线性可分:PLA一点点错误:Pocket Algorithm严格非线性:Φ(X)Φ(X)Φ(X) + PLA接下来,详细解释下,这三种模型如何而来。PLA 的演变过程PLA 全称是 Perceptron Linear Algorithm,即线性感知机算法,属于一种最简单的感知机(Perceptron)模型。...
2020-04-06 16:28:26 832
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人