Loading

上一页 1 2 3 4 5 6 7 8 9 10 ··· 12 下一页
摘要: 1. 使用BigDecimal double v = 1.233; double res = new BigDecimal(v).setScale(2, RoundingMode.HALF_UP).doubleValue(); tip: setScale中的 roundingMode参数详解,参考此 阅读全文
posted @ 2021-05-05 17:36 Convict 阅读(272) 评论(0) 推荐(0) 编辑
摘要: 1. 删除指定行 new_df = df.drop(index='行索引') new_df = df.drop('行索引', axis='index') new_df = df.drop('行索引', axis=0) 2. 删除指定的多行 new_df = df.drop(index=['行索引1' 阅读全文
posted @ 2021-04-27 12:28 Convict 阅读(8351) 评论(0) 推荐(0) 编辑
摘要: (一)Series初始化 1.通过列表,index自动生成 se = pd.Series(['Tom', 'Nancy', 'Jack', 'Tony']) print(se) 2.通过列表,指定index se = pd.Series(['Tom', 'Nancy', 'Jack', 'Tony' 阅读全文
posted @ 2021-04-27 11:23 Convict 阅读(1974) 评论(0) 推荐(0) 编辑
摘要: 1. Series Series通俗来讲就是一维数组,索引(index)为每个元素的下标,值(value)为下标对应的值 例如: arr = ['Tom', 'Nancy', 'Jack', 'Tony'] 那在Series中为:index为0,value为Tomindex为1,value为Nanc 阅读全文
posted @ 2021-04-27 10:22 Convict 阅读(329) 评论(0) 推荐(0) 编辑
摘要: 1. 解压后根目录添加配置文件my.ini [client] default-character-set=utf8mb4 [mysql] default-character-set=utf8mb4 [mysqld] character-set-server=utf8mb4 collation-ser 阅读全文
posted @ 2021-04-22 12:15 Convict 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 二分查找的前提是线性表(数组、列表)是已经有序排列的,如果无序则需要先排序。释义参考百度百科 1.循环二分查找 public static int binarySearch(int[] ints, int target) { int start = 0; int end = ints.length 阅读全文
posted @ 2021-04-14 14:24 Convict 阅读(94) 评论(0) 推荐(0) 编辑
摘要: public static boolean isPrime(int num) { /* * 质数定义:只有1和它本身两个因数的自然数 * * 1. 小于等于1或者是大于2的偶数,直接返回false * 2. 2直接返回true * 3. 从3开始算起(每次加2,截止为输入值的平方根),每次输入值除以 阅读全文
posted @ 2021-04-12 10:32 Convict 阅读(2815) 评论(0) 推荐(0) 编辑
摘要: public static boolean isPalindrome(String str) { int start = 0, end = str.length() - 1; while (start < end) { if (str.charAt(start) != str.charAt(end) 阅读全文
posted @ 2021-04-11 10:58 Convict 阅读(435) 评论(0) 推荐(0) 编辑
摘要: 测试代码 public class SingleTest { public static String v = "StaticValue"; static { System.out.println("static静态变量:" + v); System.out.println("static静态块") 阅读全文
posted @ 2021-03-05 10:14 Convict 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 一.字符流:读写纯文本(txt,csv等), 1 字符流写文件主要用:FileWriter,BufferedWriter,PrintWriter 1.1 测试 FileWriter 写入 private void writeFileWriter() throws IOException { try 阅读全文
posted @ 2020-12-23 11:54 Convict 阅读(851) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 12 下一页