1
1
[ // ] : # ( title: parse )
2
2
<!-- -IMPORT org.jetbrains.kotlinx.dataframe.samples.api.Modify-->
3
3
4
- Returns [ ` DataFrame ` ] ( DataFrame.md ) in which given ` String ` columns are parsed into other types.
4
+ Returns a [ ` DataFrame ` ] ( DataFrame.md ) in which the given ` String ` columns are parsed into other types.
5
5
6
- Special case of [ convert] ( convert.md ) operation.
6
+ This is a special case of the [ convert] ( convert.md ) operation.
7
7
8
8
<!-- -FUN parseAll-->
9
9
@@ -14,7 +14,7 @@ df.parse()
14
14
<dataFrame src =" org.jetbrains.kotlinx.dataframe.samples.api.Modify.parseAll.html " />
15
15
<!-- -END-->
16
16
17
- To parse only particular columns use [ column selector] ( ColumnSelectors.md ) :
17
+ To parse only particular columns use a [ column selector] ( ColumnSelectors.md ) :
18
18
19
19
<!-- -FUN parseSome-->
20
20
@@ -25,19 +25,22 @@ df.parse { age and weight }
25
25
<dataFrame src =" org.jetbrains.kotlinx.dataframe.samples.api.Modify.parseSome.html " />
26
26
<!-- -END-->
27
27
28
- ` parse ` tries to parse every` String ` column into one of supported types in the following order:
28
+ ` parse ` tries to parse every ` String ` column into one of supported types in the following order:
29
29
* ` Int `
30
30
* ` Long `
31
- * ` LocalDateTime `
32
- * ` LocalDate `
33
- * ` LocalTime `
34
- * ` URL `
35
- * ` Double `
31
+ * ` Instant ` (` kotlinx.datetime ` and ` java.time ` )
32
+ * ` LocalDateTime ` (` kotlinx.datetime ` and ` java.time ` )
33
+ * ` LocalDate ` (` kotlinx.datetime ` and ` java.time ` )
34
+ * ` Duration ` (` kotlin.time ` and ` java.time ` )
35
+ * ` LocalTime ` (` java.time ` )
36
+ * ` URL ` (` java.net ` )
37
+ * ` Double ` (with optional locale settings)
36
38
* ` Boolean `
37
39
* ` BigDecimal `
40
+ * ` JSON ` (arrays and objects)
38
41
39
42
Available parser options:
40
- * ` locale: Locale ` is used to parse numbers
43
+ * ` locale: Locale ` is used to parse doubles
41
44
* ` dateTimePattern: String ` is used to parse date and time
42
45
* ` dateTimeFormatter: DateTimeFormatter ` is used to parse date and time
43
46
* ` nullStrings: List<String> ` is used to treat particular strings as ` null ` value. Default null strings are ** "null"** and ** "NULL"**
@@ -51,7 +54,8 @@ df.parse(options = ParserOptions(locale = Locale.CHINA, dateTimeFormatter = Date
51
54
<dataFrame src =" org.jetbrains.kotlinx.dataframe.samples.api.Modify.parseWithOptions.html " />
52
55
<!-- -END-->
53
56
54
- You can also set global parser options that will be used by default in [ ` read ` ] ( read.md ) , [ ` convert ` ] ( convert.md ) and ` parse ` operations:
57
+ You can also set global parser options that will be used by default in [ ` read ` ] ( read.md ) , [ ` convert ` ] ( convert.md ) ,
58
+ and ` parse ` operations:
55
59
56
60
<!-- -FUN globalParserOptions-->
57
61
0 commit comments