Comments (4)
They definitely have to be strings because I can see people using dataframes to work on external data and you don't want to convert to atoms. On the other hand, for things like dtypes, having them as atoms is definitely more convenient. So I would go with supporting both but normalizing all of them to strings on the facade API instead of the backend, as this is shared logic across all backends and all shared logic goes in the facade.
from explorer.
@losvedir what do you think about everything accepting strings for column names but some places also accepting atoms where it may be more convenient or readable (e.g. keyword lists as arguments)?
Sounds good to me! As long as the whole interface accepts one or the other then I'm happy. And it makes sense to me for that to be strings not only because that works more easily with different backends per what José said, but also because that's what the library drives you towards in the core interaction with DataFrames: you do df["my_col"]
and not df[:my_col]
or df.my_col
. From what I've come across I've only run into dtypes
not supporting strings, and that's an easy fix.
Personally, I don't find [col: :string]
that much more convenient than [{"col", :string}]
or %{"col" => :string}
and so think the conceptual inconsistency isn't worth the benefit, but I think reasonable people can disagree here. If others like the keyword list approach (and it sounds like that's the case) then also supporting atoms for column names there makes sense. Though, actually, I think maybe then it would make sense in that case to support atoms everywhere column names are used? I think this is what José suggested, though contrary to your question to me which says "some places".
But don't give undue weight to my thoughts. This is your library, and José is the unparalleled genius in development experience. I'm only chiming in here because you asked directly and so, well, here are my two cents. 😄
from explorer.
This is pretty much the approach I've taken for column names -- support both but normalize on the facade API. There are a couple places where I think strings aren't supported and I'll try to root those out (the dtypes/schema approach above definitely is one of those). @losvedir what do you think about everything accepting strings for column names but some places also accepting atoms where it may be more convenient or readable (e.g. keyword lists as arguments)?
from explorer.
This was actually closed with #62!
from explorer.
Related Issues (20)
- AVX support HOT 1
- Support relocating columns
- Query Engine HOT 1
- Precompiled NIFs for freebsd HOT 2
- Add parse datetime from string HOT 1
- add DataFrame.frequencies/2 HOT 1
- Q: How to specify that a number is an epoch when reading a Parquet file? HOT 4
- Normalise errors to return `Exception.t()` from the backend HOT 6
- Document `:backend` and `:lazy` options for `from_*` IO functions HOT 1
- Normalize IO dataframe operations to return {:error, Exception.t}
- `mix ci` difficulties on MacOS as an Elixir beginner HOT 2
- `Explorer.Series.cut` crashes when series is a dataframe field HOT 1
- Add binding to str.slice and/or str.split and/or add trim/2 HOT 6
- `DataFrame.from_csv` incorrectly reads "NA" as `nil` HOT 2
- [Question] Linting Elixir code as an Elixir beginner HOT 1
- Pairwise operations HOT 2
- mutate only certain rows based on a filter? HOT 5
- It is not clear how to filter on categories HOT 3
- Aggregate a series to list in groupby HOT 2
- Missing behaviour on filtering DataFrames on categories. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from explorer.