Skip to content

Commit

Permalink
Example updated to show conversion to a Matrix (#1078)
Browse files Browse the repository at this point in the history
* Example updated to show conversion to a Matrix

* update reading a text matrix into a Matrix type

Now also without using DataFrames
  • Loading branch information
a2ray committed Apr 23, 2023
1 parent ac11e05 commit b3b717a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/src/examples.md
Expand Up @@ -576,6 +576,14 @@ data = """

file = CSV.File(IOBuffer(data); header=false)
file = CSV.File(IOBuffer(data); header=false, delim=' ', types=Float64)

# as a last step if you want to convert this to a Matrix, this can be done by reading in first as a DataFrame and then
# function chaining to a Matrix
using DataFrames
A = file|>DataFrame|>Matrix

# another alternative is to simply use CSV.Tables.matrix and say
B = file|>CSV.Tables.matrix # does not require DataFrames
```

## [Providing types](@id types_example)
Expand Down

0 comments on commit b3b717a

Please sign in to comment.