上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 40 下一页
摘要: 注意,这里是按生成类别时的顺序排序,不是按词汇排序: In [133]: df.sort_values(by="grade") Out[133]: id raw_grade grade 5 6 e very bad 1 2 b good 2 3 b good 0 1 a very good 3 4 阅读全文
posted @ 2021-10-03 18:22 不详·Christina 阅读(30) 评论(0) 推荐(0)
摘要: 封装了一下工具类 public static String postGeneralUrl(String generalUrl, String contentType, String params, String encoding) throws Exception { URL url = new U 阅读全文
posted @ 2021-10-02 20:33 不详·Christina 阅读(22) 评论(0) 推荐(0)
摘要: 今天去优化了一下上传public static String advancedGeneral(File file) { // 请求url String url = "https://aip.baidubce.com/rest/2.0/image-classify/v2/advanced_genera 阅读全文
posted @ 2021-10-01 19:33 不详·Christina 阅读(36) 评论(0) 推荐(0)
摘要: 数据输入 / 输出 #CSV 写入 CSV 文件 (opens new window)。 In [143]: df.to_csv('foo.csv') 读取 CSV 文件数据: In [144]: pd.read_csv('foo.csv') Out[144]: Unnamed: 0 A B C D 阅读全文
posted @ 2021-09-30 20:44 不详·Christina 阅读(18) 评论(0) 推荐(0)
摘要: Head 与 Tail head() (opens new window)与 tail() (opens new window)用于快速预览 Series 与 DataFrame,默认显示 5 条数据,也可以指定显示数据的数量。 In [4]: long_series = pd.Series(np. 阅读全文
posted @ 2021-09-29 20:27 不详·Christina 阅读(23) 评论(0) 推荐(0)
摘要: 今天做了文件下载 public class DownloadAndUploadController { @Autowired private Upload upload; @Autowired private ImgMapper imgService; @RequestMapping("/Uploa 阅读全文
posted @ 2021-09-28 20:26 不详·Christina 阅读(28) 评论(0) 推荐(0)
摘要: 属性与底层数据 Pandas 可以通过多个属性访问元数据: shape: 输出对象的轴维度,与 ndarray 一致 轴标签 Series: Index (仅有此轴) DataFrame: Index (行) 与列 注意: 为属性赋值是安全的! In [7]: df[:2] Out[7]: A B 阅读全文
posted @ 2021-09-27 20:22 不详·Christina 阅读(38) 评论(0) 推荐(0)
摘要: Pandas 对象(Index (opens new window), Series (opens new window), DataFrame (opens new window))相当于数组的容器,用于存储数据、执行计算。大部分类型的底层数组都是 numpy.ndarray (opens new 阅读全文
posted @ 2021-09-26 20:37 不详·Christina 阅读(28) 评论(0) 推荐(0)
摘要: Series 与 Index 的类型是 ExtensionArray (opens new window)时, to_numpy() (opens new window)会复制数据,并强制转换值。详情见数据类型 (opens new window)。 to_numpy() (opens new wi 阅读全文
posted @ 2021-09-25 20:22 不详·Christina 阅读(26) 评论(0) 推荐(0)
摘要: DataFrame 为同构型数据时,Pandas 直接修改原始 ndarray,所做修改会直接反应在数据结构里。对于异质型数据,即 DataFrame 列的数据类型不一样时,就不是这种操作模式了。与轴标签不同,不能为值的属性赋值。 注意 处理异质型数据时,输出结果 ndarray 的数据类型适用于涉 阅读全文
posted @ 2021-09-24 19:45 不详·Christina 阅读(22) 评论(0) 推荐(0)
上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 40 下一页