Home  >  Q&A  >  body text

python - DataFrame usage issues

fram=DataFrame(records)
cframe=fram[fram['a'].notnull()]

The second line cannot be understood. fram['a'].notnull() is pandas.core.series.Series, how can I pass fram[.. .] Converted to pandas.core.frame.DataFrame. What is the syntax of frame[...].

大家讲道理大家讲道理2712 days ago567

reply all(1)I'll reply

  • 巴扎黑

    巴扎黑2017-05-18 10:48:18

    fram['a'].notnull() will return a list of Boolean values, and then use fram[] to get the rows with true values. This is a common usage of pandas to get the number of rows.

    reply
    0
  • Cancelreply