0

I see a lot of tutorials, data science, and ML related stuff, doing something like this in Pytohn

data[data["total_savings"] < 400000]

so they can search the list faster, rather than using the map() function

what's that?? and how to use it?

and what is it called so I can search for it?

A l w a y s S u n n y
  • 36,497
  • 8
  • 60
  • 103
  • it is a kind of filtering on the data i.e dataframe, which means get all the rows from data where `total_savings` is less than `400000`, see examples: https://www.geeksforgeeks.org/selecting-rows-in-pandas-dataframe-based-on-conditions/ – A l w a y s S u n n y Oct 03 '22 at 10:04
  • This would generally be called masking: https://stackoverflow.com/a/38802912/9811508 – Tobias P. G. Oct 03 '22 at 10:04
  • This notation is used with pandas dataframes – Ryo Suzuki Oct 03 '22 at 10:19
  • This is called [boolean indexing](https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#boolean-indexing) – mozway Oct 03 '22 at 11:03

0 Answers0