- 博客(6)
- 收藏
- 关注
转载 python基础复习 - 列表基本操作
1 class list(object): 2 """ 3 Built-in mutable sequence. 4 5 If no argument is given, the constructor creates a new empty list. 6 The argument must be an itera...
2018-11-10 10:10:00
154
转载 python基础复习 - 字符串常用操作
字符串正序反序和切片 对于字符串 theString = 'a game of thrones' 基于切片的操作 原值 theString[:] 'a game of thrones' 或 theString[::1] 'a game of thrones' 反序 theString[::-1] 'senorht fo...
2018-11-05 14:53:00
140
转载 Leetcode - 371. Sum of Two Integers
题设: Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -. 解题思路: 使用加法器 代码: class Solution: def getSum(self, num1, num2): if (num2...
2018-10-24 17:50:00
100
转载 Leetcode - 693. Binary Number with Alternating Bits
题目为 Given a positive integer, check whether it has alternating bits: namely, if two adjacent bits will always have different values. 解题思路: 题设要求判断形如101010的数字,那么如何在复杂度最小的情况下给出算法呢 首先看一下用pyth...
2018-10-24 17:37:00
91
转载 python基础复习-循环语句continue
n=0 while n<100: n+=1 if n>10 and n<90: continue print(n) 当n在10到90的区间内,程序运行到continue时,会直接返回到while并直接跳过print。 输入结果为: 1 2 3 4 5 6 7 8 9 10 90 ...
2018-10-24 16:20:00
156
转载 DataFrame排序问题
1 from pandas import DataFrame 2 df = DataFrame(dictList) 3 df = df.sort_values(by='internalReturn', ascending=False) 现在正在写一个122个品种的实时风险分析的程序,能够提取最佳的交易品种以及他们的持仓周期等信息。由于指标比较多,所以决定用DataFrame...
2016-09-27 16:53:00
144
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人