In dask, is there a similar way like ' .loc ' in pandas?

Viewed 66

I want to plot Ra and Dec of astronomical objects. I was using Pandas but I got more data ~ 500,000 sample size. Here's a python code (that worked...)

#assigning ra and dec of all objects that are classified as galaxies
l_rad_galaxy = df.loc[df["class"] == "GALAXY", "ra"]
b_rad_galaxy = df.loc[df["class"] == "GALAXY", "dec"]

Now for handling 500,000 sample size, I'm using Dask to read the csv file. But when I was running the above code, the following error is generated -

KeyError: 'class'

There is a feature 'class' in the data. I want to extract all values for Ra and Dec, only from those samples whose 'class' is 'GALAXY'.

What is the Dask alternative for the above code?

PS: I have tried using getitem but it's also not working.

0 Answers
Related