Skip to content

Conversation

@Zesky665
Copy link

Updated the readme with an example of turning a list of maps into a dataframe.

Updated the readme with an example of turning a list of maps into a dataframe.
Copy link
Member

@billylanchantin billylanchantin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @Zesky665! I agree this explanation could be improved.

Actually, can I ask that we expand the scope of your changes a bit? Something like this:

You can pass the data in column-wise as a map (or keyword) of series:

```elixir
name = Explorer.Series.from_list(["Everest", "K2", "Aconcagua"])
elevation = Explorer.Series.from_list([8848, 8611, 6962])
mountains = Explorer.DataFrame.new(name: name, elevation: elevation)
```

Or you can pass the data in column-wise as a map (or keyword) of lists:

```elixir
mountains = Explorer.DataFrame.new(
  name: ["Everest", "K2", "Aconcagua"],
  elevation: [8848, 8611, 6962]
)
```

Or you can pass it in row-wise as a list of maps (or keywords):

```elixir
mountains = Explorer.DataFrame.new([
  [name: "Everest", elevation: 8848],
  [name: "K2", elevation: 8611],
  [name: "Aconcagua", elevation: 6962]
])
```

All are equivalent, and your dataframe will look like this:

This way, your change and the clause that precedes will feel cohesive IMO. I leave the exact wording up to you, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants