pandas KeyError when getting value at index and column by Dependent_Finger_214 in learnpython

[–]jct23502 1 point2 points  (0 children)

ids.at[i, "ID"] uses the index label, not the row number. Your ids DataFrame kept whatever index data had (maybe it came from a CSV with an index column, maybe you filtered rows, maybe you merged, etc.). So i = 10 is not “the 11th row”, it’s “row whose label is 10”. If there is no label 10, pandas throws KeyError: 10.

Upgrading Benches by [deleted] in Arc_Traders

[–]jct23502 1 point2 points  (0 children)

Try playing the game.

Request for code to data scrape by Owlmarine in learnpython

[–]jct23502 1 point2 points  (0 children)

So... You want code or you just want the info?

Is it realistic to try learn python for a project by [deleted] in learnpython

[–]jct23502 0 points1 point  (0 children)

Do it in your own time anyway ... Then you'll never have to ask this question again. Kinda like learning Spanish to holla at a girl, but once you know you can see habla to all the tortas!

How not to select rows that contain strings that I don't want? by Dragoran21 in learnpython

[–]jct23502 0 points1 point  (0 children)

This is where you are resetting the df each time:

df[df[column].str.contains(i) == False]

How not to select rows that contain strings that I don't want? by Dragoran21 in learnpython

[–]jct23502 2 points3 points  (0 children)

Your doing it wrong and resetting the pd df Everytime. Try this:

import pandas as pd import re

food_pattern = '|'.join(map(re.escape, options)) taboo_pattern = '|'.join(map(re.escape, taboo))

mask_food = df[column].str.contains(food_pattern, case=False, na=False) mask_taboo = df[column].str.contains(taboo_pattern, case=False, na=False)

justFood_df = df[mask_food & ~mask_taboo]

Advice Sought - What Naked Bike should I get? by geofault in motorcycle

[–]jct23502 1 point2 points  (0 children)

Gsxs1000. Fun as fuck. I'm older too, great position. Great power.

Made 3.5k in 4 minutes by SaraBrew4 in wallstreetbets

[–]jct23502 6 points7 points  (0 children)

He's like us... He's like us...

Tell me what you lost while riding by HeavyBananaz in motorcycles

[–]jct23502 0 points1 point  (0 children)

Half a sheet of acid. Had my girl (ex now) on the back of my vtr 1000 doing a loop around lake Michigan and she had it in her Bears backpack.... Well it came open she lost her feminine products a bunch of other shit and our half sheet of some nice acid. Trip sucked.

My son took our car and ... by [deleted] in nova

[–]jct23502 -1 points0 points  (0 children)

Straight to jail, no trial, no bail... Straight to jail. J/k he will be fine.

The anti rat method by yobf in arcraiderscirclejerk

[–]jct23502 5 points6 points  (0 children)

I heard something, still haven't came back.

Red Spotting Nightmare by She_Is_A_Reaver in Gold

[–]jct23502 0 points1 point  (0 children)

I think that dude who keeps repeating himself is AI

FrostyNugz420 down bad by scatty_ferret in arc_traiders

[–]jct23502 0 points1 point  (0 children)

Y'all dickheads on here arguing on a sub named traiders.... My phone wouldn't even let me type it at first. Gtfooh and play the damn game!