Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning: getindex(df::DataFrame, col_ind::ColumnIndex) is deprecated #2532

Closed
Beramos opened this issue Nov 10, 2020 · 3 comments
Closed

Warning: getindex(df::DataFrame, col_ind::ColumnIndex) is deprecated #2532

Beramos opened this issue Nov 10, 2020 · 3 comments

Comments

@Beramos
Copy link

Beramos commented Nov 10, 2020

This deprecation warning is very unclear to me since the only thing I'm doing is the following,

image

I don't see why this slicing should lead to deprecation warnings.

Julia version 1.3.1

CSV v0.7.7
DataFrames v0.21.8
GalvanostatLNP v0.1.0
OrdinaryDiffEq v5.42.3
@bkamins
Copy link
Member

bkamins commented Nov 10, 2020

It should print a deprecation because the syntax DF_0Hz_short["<Ewe>/V"] is not supported. It was supported many years ago, and we left a depwarn for some time for the users to accommodate their legacy code. In 2 weeks from now it will error.

The correct syntax is DF_0Hz_short."<Ewe>/V" or equivalently DF_0Hz_short.[!, "<Ewe>/V"] or if you want to copy the vector you extract from the data frame: DF_0Hz_short.[:, "<Ewe>/V"].

@bkamins bkamins closed this as completed Nov 10, 2020
@Beramos
Copy link
Author

Beramos commented Nov 10, 2020 via email

@bkamins
Copy link
Member

bkamins commented Nov 10, 2020

Maybe as an additional comment - DataFrame is a 2-dimensional object, so for consistency when using indexing syntax df[...] it requires two dimensions to be passed. It is not much more typing but avoids confusion.

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

No branches or pull requests

2 participants