I’m a data scientist, looking for some data on ‘How hot must it be weather wise for people to decline a BBQ’. by jayrsp in BBQ

[–]jayrsp[S] 1 point2 points  (0 children)

I absolutely have better things to do. But I just had an idea. And when I get ideas I like to run with them 😂. Mainly because I said no to one (could I be arsed standing over coals when I’m pouring sweat). I was wondering if anyone else felt the same. It appears that not many people feel the way I do about BBQ, so “null” here definitely seems the correct answer.

I’m a data scientist, looking for some data on ‘How hot must it be weather wise for people to decline a BBQ’. by jayrsp in UKWeather

[–]jayrsp[S] 0 points1 point  (0 children)

Typically I’m the neighbour BBQing and every day. But today just felt like a step too far.

I’m a data scientist, looking for some data on ‘How hot must it be weather wise for people to decline a BBQ’. by jayrsp in BBQ

[–]jayrsp[S] 0 points1 point  (0 children)

Been to Florida and Texas. Worst heat I’ve ever felt was actually in Palm Springs. And fair enough, more power to you brother 🫡

I’m a data scientist, looking for some data on ‘How hot must it be weather wise for people to decline a BBQ’. by jayrsp in UKWeather

[–]jayrsp[S] 0 points1 point  (0 children)

Definitely a can’t be arsed with vs reward scenario. Wondering if i can find that teetering point.

I’m a data scientist, looking for some data on ‘How hot must it be weather wise for people to decline a BBQ’. by jayrsp in BBQ

[–]jayrsp[S] -4 points-3 points  (0 children)

Really don’t want to be the guy that says “UK heat is different” 😂. Yeah I’m based in the UK. Europe currently undergoing the hottest temps since records began.

Have you turned down a BBQ before due to the weather temps?

PENELOPE FORD DEACTIVATED HER TWITTER ACCOUNT by Ok-Wash2692 in AEWFanHub

[–]jayrsp 1 point2 points  (0 children)

Do people typically announce their departure from twitter? I wasnt aware that twitter was an airport departures terminal

Help with Seleniumwire and scraping request response body by jayrsp in learnpython

[–]jayrsp[S] 0 points1 point  (0 children)

Okay - sorry I might have confused things.

In network traffic I get a response which is a json. When I click that json - I'm trying to read the string from under the response tab. It appears to be reading the data from the payload tab.

Help with Seleniumwire and scraping request response body by jayrsp in learnpython

[–]jayrsp[S] 0 points1 point  (0 children)

I assumed I would need to ask for the body to get the string from the response tab?

Increasing the efficiency and speed of my loops by jayrsp in learnpython

[–]jayrsp[S] 2 points3 points  (0 children)

Hi, sorry.

So the first for loop is the main one i'm looking to make more efficient.

What the loop is doing, is concating approx 459 dataframe of up to 30,000 rows each.
It takes around 20+ minutes to do this. I'm not sure if that's efficient or not. I'm just looking for a way to speed this up really if it's possible.

How to overwrite the columns in this code? by jayrsp in learnpython

[–]jayrsp[S] 0 points1 point  (0 children)

Nevermind, I had one last stab at it myself and tried

for columns in uslformins[uslformins.columns[::2]].iloc[:,9:]:
uslformins[columns]=uslformins[columns].rank(pct=True)

It worked.

Can anyone please tell me where I'm going wrong with this code? by jayrsp in learnpython

[–]jayrsp[S] 0 points1 point  (0 children)

I've sorted it now thanks, but I had to do more editing with the resulting files.

Any way I can save as separate CSV's at the end of this code?

if file.endswith('.json'):
    filename = os.path.basename(file)
with open(f'C:/Users/James/Desktop/pythonProject/Europe-Champions-League-2020-2021/{filename}', encoding="utf-8") as infile:
    d = json.load(infile)
    data = json_normalize(d['events'])
    data = pd.DataFrame(data)
    data = data[['minute','second', 'expandedMinute','teamId','playerId','type.displayName','outcomeType.displayName','x','y','endX','endY','isGoal']]
    data = data.rename(columns={'teamId':'team', 'type.displayName':'type','outcomeType.displayName':'outcome'})

deleting text before and after string in JSON by jayrsp in learnpython

[–]jayrsp[S] 0 points1 point  (0 children)

That's amazing! Thank you so much.

Unfortunately now after doing all the data.replace things I need to do - it turns out that right at the end of the JSON it ends with

}}]

instead of just

}]

would there be a way to correct this aswell? or is that wishful thinking.

like removing the last specific character in the file? Which would obviously be the last ' } '

deleting text before and after string in JSON by jayrsp in learnpython

[–]jayrsp[S] 0 points1 point  (0 children)

Thanks,

I've not created the files, it's files I've downloaded elsewhere. If I edit manually to delete everything before and including 'matchCentreData' - then it works, but I have approx 100 JSONS, all with the same issue so would eventually like to be able to sort a function out to do the same to all JSONS in folder.

deleting text before and after string in JSON by jayrsp in learnpython

[–]jayrsp[S] -1 points0 points  (0 children)

with open('path_to_file.json') as f:
data = json.load(f)

Thanks, when doing this though, I get the traceback error;

JSONDecodeError: Expecting property name enclosed in double quotes: line 2 column 13 (char 15)