You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What I miss is clear path from cards to notes, f.e. I've got a list of nid (notes id), which I query from cards and then perform cards selection, something like:
nids = cards[cards.cdeck == 'DECK"].nid.tolist()
notes[notes.id in nids]
If this is even possible, it's not written in documentation
Hi @dodokpeter . So you're asking about the general case of having a list of note ids and wanting to retrieve the corresponding rows from the notes table (I'm a bit confused because you wrote that you want to select cards, but then start with notes[notes.id...])?
You can do this as follows:
# note IDs gotten e.g. from a query on cardsnids= [ 1299250735320, 1299250735321]
# get a DataFrame of rows for these note IDsrelevant_notes=notes.loc[nids]
It's not documented in ankipandas, because it's a standard feature of pandas. You can find a bit more information here: indexing in pandas, dataframe.loc
Easy to use method that can perform most selections.
With options:
??
or should we have
is_
... methods instead?Maybe?
The text was updated successfully, but these errors were encountered: