daru
https://github.com/sciruby/daru
Ruby
Data Analysis in RUby
Daru::DataFrame.from_csv
Load data from a CSV file. Specify an optional block to grab the CSV
object and pre-condition it (for example use the `convert` or
`header_convert` methods).
== Arguments
* path - Local path / Remote URL of the file to load specified as a String.
== Options
Accepts the same options as the Daru::DataFrame constructor and CSV.open()
and uses those to eventually construct the resulting DataFrame.
== Verbose Description
You can specify all the options to the `.from_csv` function that you
do to the Ruby `CSV.read()` function, since this is what is used internally.
For example, if the columns in your CSV file are separated by something
other that commas, you can use the `:col_sep` option. If you want to
convert numeric values to numbers and not keep them as strings, you can
use the `:converters` option and set it to `:numeric`.
The `.from_csv` function uses the following defaults for reading CSV files
(that are passed into the `CSV.read()` function):
{
:col_sep => ',',
:converters => :numeric
}Edit
git clone [email protected]:sciruby/daru.git
cd daru
open lib/daru/dataframe.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-Daru--DataFrame-from_csv-for-pr
# Commit to gitgit add lib/daru/dataframe.rbgit commit -m "better docs for Daru::DataFrame.from_csv"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-Daru--DataFrame-from_csv-for-pr
hub pull-request
# Celebrate!