--
You received this message because you are subscribed to the Google Groups "PyData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pydata+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to pydata+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "PyData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pydata+un...@googlegroups.com.
But there aren't any missing columns!cols = interesting + [c for c in df.columns if c not in interesting]return df.loc[:,cols]the set 'cols' must include all df.columns, by construction
On Wed, Nov 15, 2017 at 10:11 AM Joris Van den Bossche <jorisvand...@gmail.com> wrote:
There is some explanation about this in the release notes of 0.21.0: http://pandas.pydata.org/pandas-docs/stable/whatsnew.html#indexing-with-a-list-with-missing-labels-is-deprecated (see also the linked github issue). The main reason for this warning (and future key error) is that we wanted to make .loc more strict to let it only select existing labels, and no longer introduce new columns or rows with NaNs.Does that clarify things? Otherwise feel free to ask further!Joris2017-11-15 13:43 GMT+01:00 Neal Becker <ndbe...@gmail.com>:
I am getting this warning from this code:interesting = ['channel', 'lambda', 'G_info', 'pwr', 'rate', 'arrival', 'threshold', 'ber', 'per', 'errs', 'packet_errs', 'miss/burst', 'fake/good', 'mean_dem_iter', 'random_freq', 'recheck_corr']cols = interesting + [c for c in df.columns if c not in interesting]return df.loc[:,cols]It would seem with this construction it's impossible that any label could be missing, so I don't understand why this warning.
--
You received this message because you are subscribed to the Google Groups "PyData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pydata+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "PyData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pydata+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "PyData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pydata+unsubscribe@googlegroups.com.
You probably just want cols = df.columns & interesting.In `cols = interesting + [c for c in df.columns if c not in interesting]`, any cols in interesting that aren't in df.columns will be included.Are you sure you want the `interesting +` at the front?- Tom
On Thu, Nov 16, 2017 at 6:28 AM, Neal Becker <ndbe...@gmail.com> wrote:
But there aren't any missing columns!cols = interesting + [c for c in df.columns if c not in interesting]return df.loc[:,cols]the set 'cols' must include all df.columns, by construction
On Wed, Nov 15, 2017 at 10:11 AM Joris Van den Bossche <jorisvand...@gmail.com> wrote:
There is some explanation about this in the release notes of 0.21.0: http://pandas.pydata.org/pandas-docs/stable/whatsnew.html#indexing-with-a-list-with-missing-labels-is-deprecated (see also the linked github issue). The main reason for this warning (and future key error) is that we wanted to make .loc more strict to let it only select existing labels, and no longer introduce new columns or rows with NaNs.Does that clarify things? Otherwise feel free to ask further!Joris2017-11-15 13:43 GMT+01:00 Neal Becker <ndbe...@gmail.com>:
I am getting this warning from this code:interesting = ['channel', 'lambda', 'G_info', 'pwr', 'rate', 'arrival', 'threshold', 'ber', 'per', 'errs', 'packet_errs', 'miss/burst', 'fake/good', 'mean_dem_iter', 'random_freq', 'recheck_corr']cols = interesting + [c for c in df.columns if c not in interesting]return df.loc[:,cols]It would seem with this construction it's impossible that any label could be missing, so I don't understand why this warning.
--
You received this message because you are subscribed to the Google Groups "PyData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pydata+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "PyData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pydata+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "PyData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pydata+un...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "PyData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pydata+un...@googlegroups.com.
This may not be the simplest way, my intention was to reorder the columns to put the "interesting" ones first
On Thu, Nov 16, 2017 at 7:31 AM Tom Augspurger <tom.augs...@gmail.com> wrote:
You probably just want cols = df.columns & interesting.In `cols = interesting + [c for c in df.columns if c not in interesting]`, any cols in interesting that aren't in df.columns will be included.Are you sure you want the `interesting +` at the front?- Tom
On Thu, Nov 16, 2017 at 6:28 AM, Neal Becker <ndbe...@gmail.com> wrote:
But there aren't any missing columns!cols = interesting + [c for c in df.columns if c not in interesting]return df.loc[:,cols]the set 'cols' must include all df.columns, by construction
On Wed, Nov 15, 2017 at 10:11 AM Joris Van den Bossche <jorisvand...@gmail.com> wrote:
There is some explanation about this in the release notes of 0.21.0: http://pandas.pydata.org/pandas-docs/stable/whatsnew.html#indexing-with-a-list-with-missing-labels-is-deprecated (see also the linked github issue). The main reason for this warning (and future key error) is that we wanted to make .loc more strict to let it only select existing labels, and no longer introduce new columns or rows with NaNs.Does that clarify things? Otherwise feel free to ask further!Joris2017-11-15 13:43 GMT+01:00 Neal Becker <ndbe...@gmail.com>:
I am getting this warning from this code:interesting = ['channel', 'lambda', 'G_info', 'pwr', 'rate', 'arrival', 'threshold', 'ber', 'per', 'errs', 'packet_errs', 'miss/burst', 'fake/good', 'mean_dem_iter', 'random_freq', 'recheck_corr']cols = interesting + [c for c in df.columns if c not in interesting]return df.loc[:,cols]It would seem with this construction it's impossible that any label could be missing, so I don't understand why this warning.
--
You received this message because you are subscribed to the Google Groups "PyData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pydata+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "PyData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pydata+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "PyData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pydata+unsubscribe@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "PyData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pydata+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "PyData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pydata+unsubscribe@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to pydata+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "PyData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pydata+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "PyData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pydata+un...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "PyData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pydata+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "PyData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pydata+un...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "PyData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pydata+un...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to pydata+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "PyData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pydata+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "PyData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pydata+unsubscribe@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "PyData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pydata+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "PyData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pydata+unsubscribe@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "PyData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pydata+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "PyData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pydata+unsubscribe@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to pydata+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "PyData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pydata+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "PyData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pydata+un...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "PyData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pydata+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "PyData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pydata+un...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "PyData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pydata+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "PyData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pydata+un...@googlegroups.com.