• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录

nunca

但行好事 莫问前程
  • 博客园
  • 联系
  • 订阅
  • 管理

公告

04 2018 档案

TypeError: only integer scalar arrays can be converted to a scalar index
摘要:把代码处修改如下: 阅读全文

posted @ 2018-04-30 23:47 乐晓东随笔 阅读(5215) 评论(0) 推荐(0)

LeetCode Easy: 33. Search in Rotated Sorted Array
摘要:一、题目 Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., [0,1,2,4,5,6,7] might become [4,5,6,7,0,1,2 阅读全文

posted @ 2018-04-30 10:58 乐晓东随笔 阅读(163) 评论(0) 推荐(0)

LeetCode Medium: 31. Next Permutation
摘要:一、题目 Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not p 阅读全文

posted @ 2018-04-29 10:00 乐晓东随笔 阅读(128) 评论(0) 推荐(0)

LeetCode Medium: 29. Divide Two Integers
摘要:一、题目 Given two integers dividend and divisor, divide two integers without using multiplication, division and mod operator. Return the quotient after d 阅读全文

posted @ 2018-04-28 16:51 乐晓东随笔 阅读(164) 评论(0) 推荐(0)

python中merge、concat用法
摘要:转载:https://blog.csdn.net/ly_ysys629/article/details/73849543 参考:https://blog.csdn.net/stevenkwong/article/details/52540605 数据规整化:合并、清理、过滤 pandas和pytho 阅读全文

posted @ 2018-04-24 17:35 乐晓东随笔 阅读(2886) 评论(0) 推荐(0)

python结巴分词
摘要:转载: http://www.cnblogs.com/jiayongji/p/7119065.html 结巴是一个功能强大的分词库。 安装jieba pip install jieba 简单用法 结巴分词分为三种模式:精确模式(默认)、全模式和搜索引擎模式,下面对这三种模式分别举例介绍: 精确模式 阅读全文

posted @ 2018-04-24 15:44 乐晓东随笔 阅读(1143) 评论(0) 推荐(0)

python中 apply()函数的用法
摘要:函数格式为:apply(func,*args,**kwargs) 用途:当一个函数的参数存在于一个元组或者一个字典中时,用来间接的调用这个函数,并肩元组或者字典中的参数按照顺序传递给参数 解析:args是一个包含按照函数所需参数传递的位置参数的一个元组,是不是很拗口,意思就是,假如A函数的函数位置为 阅读全文

posted @ 2018-04-24 12:00 乐晓东随笔 阅读(68679) 评论(0) 推荐(1)

python中输出打印避免换行、格式转化
摘要:加上下面这句代码,输出时打印不换行 np.set_printoptions(linewidth=400) 强制输出小数方法:suppress=True 强制类型转换 d2 = d1.astype(int) 阅读全文

posted @ 2018-04-24 10:48 乐晓东随笔 阅读(1156) 评论(0) 推荐(0)

LeetCode Medium:24. Swap Nodes in Pairs
摘要:一、题目 Given a linked list, swap every two adjacent nodes and return its head. Example: Note: Your algorithm should use only constant extra space. You m 阅读全文

posted @ 2018-04-22 13:01 乐晓东随笔 阅读(163) 评论(0) 推荐(0)

LeetCode Medium:22. Generate Parentheses
摘要:一、题目 Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set 阅读全文

posted @ 2018-04-21 19:55 乐晓东随笔 阅读(158) 评论(0) 推荐(0)

LeetCode Medium: 19. Remove Nth Node From End of List
摘要:一、题目 Given a linked list, remove the n-th node from the end of list and return its head. Example: Note: Given n will always be valid. 给定一个链接的 list,移除从 阅读全文

posted @ 2018-04-19 11:12 乐晓东随笔 阅读(149) 评论(0) 推荐(0)

python中numpy中的multiply、*、matul 的区别
摘要:numpy中的multiply、*、matul 的区别 1、对于矩阵(matrix)而言,multiply是对应元素相乘,而 * 、np.matmul() 函数 与 np.dot()函数 相当于矩阵乘法(矢量积),对应的列数和行数必须满足乘法规则;如果希望以数量积的方式进行,则必须使用 np.mul 阅读全文

posted @ 2018-04-17 22:11 乐晓东随笔 阅读(6348) 评论(0) 推荐(0)

LeetCode Medium: 18. 4Sum
摘要:一、题目 Given an array nums of n integers and an integer target, are there elements a, b, c, and d in nums such that a + b + c + d = target? Find all uni 阅读全文

posted @ 2018-04-17 11:12 乐晓东随笔 阅读(219) 评论(0) 推荐(0)

LeetCode Medium: 16. 3Sum Closest
摘要:一、题目 Given an array nums of n integers and an integer target, find three integers in nums such that the sum is closest to target. Return the sum of th 阅读全文

posted @ 2018-04-16 23:44 乐晓东随笔 阅读(124) 评论(0) 推荐(0)

LeetCode Medium: 17. Letter Combinations of a Phone Number
摘要:一、题目 Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. A mapping of digit 阅读全文

posted @ 2018-04-14 08:49 乐晓东随笔 阅读(170) 评论(0) 推荐(0)

LeetCode Medium:15. 3Sum
摘要:一、题目 Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives 阅读全文

posted @ 2018-04-13 09:28 乐晓东随笔 阅读(140) 评论(0) 推荐(0)

LeetCode Medium:12. Integer to Roman
摘要:一、题目 Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 to 3999. 把给定的整数转换成罗马数字 二、思路 这道题其实跟13题是两个相反的过程, 阅读全文

posted @ 2018-04-12 11:48 乐晓东随笔 阅读(128) 评论(0) 推荐(0)

LeetCode Medium: 11. Container With Most Water
摘要:一、题目 Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two 阅读全文

posted @ 2018-04-11 07:36 乐晓东随笔 阅读(149) 评论(0) 推荐(0)

TypeError: unsupported operand type(s) for /: 'map' and 'int'
摘要:遇到这样的情况,只需要把程序中的对应的map处改成如下,前面加一个list就可以啦! 阅读全文

posted @ 2018-04-10 20:36 乐晓东随笔 阅读(6569) 评论(0) 推荐(0)

LeetCode Medium: 8. String to Integer (atoi)
摘要:一、题目 Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. If you want a challenge, please do not see b 阅读全文

posted @ 2018-04-10 08:50 乐晓东随笔 阅读(166) 评论(0) 推荐(0)

LeetCode Medium: 6. ZigZag Conversion
摘要:一、题目 The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed 阅读全文

posted @ 2018-04-09 09:07 乐晓东随笔 阅读(134) 评论(0) 推荐(0)

LeetCode Medium:5. Longest Palindromic Substring
摘要:一、题目 Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example: Example: 参考博客: 阅读全文

posted @ 2018-04-08 08:04 乐晓东随笔 阅读(136) 评论(0) 推荐(0)

LeetCode Easy: 100. Same Tree
摘要:一、题目 Given two binary trees, write a function to check if they are the same or not. Two binary trees are considered the same if they are structurally 阅读全文

posted @ 2018-04-03 15:27 乐晓东随笔 阅读(169) 评论(0) 推荐(0)

LeetCode Easy: 88. Merge Sorted Array
摘要:一、题目 Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array. Note:You may assume that nums1 has enough space (siz 阅读全文

posted @ 2018-04-03 15:19 乐晓东随笔 阅读(156) 评论(0) 推荐(0)

LeetCode Easy:83. Remove Duplicates from Sorted List
摘要:一、题目 Given a sorted linked list, delete all duplicates such that each element appear only once. For example,Given 1->1->2, return 1->2.Given 1->1->2-> 阅读全文

posted @ 2018-04-01 15:48 乐晓东随笔 阅读(134) 评论(0) 推荐(0)

 
博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3