![[Kotlin]入门学习记录](http://pic.xiahunao.cn/yaotu/[Kotlin]入门学习记录)
本文为kotlin学习记录文章目录本文内容一、语法1. companion object2. 正则表达式2.1 去除特定字符二、使用步骤1.引入库2.读入数据总结本文内容本文用以记录笔者kotlin学习过程包括语法等一、语法1. companion object2. 正则表达式2.1 去除特定字符保留字母和数字fun main() { val str abc123!#中文xyz_789 // 1. 移除非字母数字的字符 val filtered: String str.replace(Regex([^a-zA-Z0-9]), ) // 2. 转为 char 数组 val charArr: CharArray filtered.toCharArray() println(filtered) // abc123xyz789 println(charArr.contentToString()) // [a, b, c, 1, 2, 3, x, y, z, 7, 8, 9] }二、使用步骤1.引入库代码如下示例import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import warnings warnings.filterwarnings(ignore)import ssl ssl._create_default_https_contextssl._create_unverified_context2.读入数据代码如下示例datapd.read_csv(https://labfile.oss.aliyuncs.com/courses/1283/adult.data.csv)print(data.head())该处使用的url网络请求的数据。总结提示这里对文章进行总结例如以上就是今天要讲的内容本文仅仅简单介绍了pandas的使用而pandas提供了大量能使我们快速便捷地处理数据的函数和方法。