ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 03 Jul 2020 14:16:11 +0200Pandas `dropna()` by column numberhttps://ask.sagemath.org/question/52246/pandas-dropna-by-column-number/In Pandas,
`df.dropna(subset=['Name of the column'])` remove all the rows of the database `df` according to the presence of a NaN sting in the column `Name of the column`. This is very nice but it will be simpler for me to do this by the number of the colomn detected by `iloc`. But I do not find the way in the documentation and in the question answer posted on the Net.
Could somebody help. ThanksSun, 28 Jun 2020 12:59:00 +0200https://ask.sagemath.org/question/52246/pandas-dropna-by-column-number/Comment by Cyrille for <p>In Pandas,</p>
<p><code>df.dropna(subset=['Name of the column'])</code> remove all the rows of the database <code>df</code> according to the presence of a NaN sting in the column <code>Name of the column</code>. This is very nice but it will be simpler for me to do this by the number of the colomn detected by <code>iloc</code>. But I do not find the way in the documentation and in the question answer posted on the Net.</p>
<p>Could somebody help. Thanks</p>
https://ask.sagemath.org/question/52246/pandas-dropna-by-column-number/?comment=52311#post-id-52311I do not know if this is an answer to my question but in fact the colomns are known by keys (number or strings). The advantage is that if adds a new column one continues to have access to any column by the key. But if the keys are too long (my cases) it becomes boring.Fri, 03 Jul 2020 14:16:11 +0200https://ask.sagemath.org/question/52246/pandas-dropna-by-column-number/?comment=52311#post-id-52311