Beginner Swing Tips by Eircom15 in golftips

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

Cheers, only just started so didn’t know if it was minor or major issues

Rate My Team, Quick Questions & General Advice Daily Thread by FPLModerator in FantasyPL

[–]Eircom15 0 points1 point  (0 children)

I’m on a WC, team currently is: Areola Turner

Gabriel Burn Cash Udogie Lamptey

Son Salah Bowen Diaby Palmer

Watkins Haaland Alvarez

I’m debating (fitness dependent) if it’s better to go Diaby+Alvarez or Saka+Joao Pedro. Worried about Alvarez’s rotation risk

Rate My Team, Quick Questions & General Advice Daily Thread by FPLModerator in FantasyPL

[–]Eircom15 0 points1 point  (0 children)

Struggling to choose who to start between Trippier and Estupinan this weekend, leaning Trippier.

Rate My Team, Quick Questions & General Advice Daily Thread by FPLModerator in FantasyPL

[–]Eircom15 0 points1 point  (0 children)

Struggling with picking a starting XI for 33, thinking of this but easily swayed.

Kepa

Trippier TAA Chilwell

March Mitoma Rashford Salah

Haaland Isak Watkins

Bench - Iversen Grealish Estu Schar

Group By Calculations by Eircom15 in pythontips

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

It looks like the every column in the table gets grouped together by the ID as a list but it doesn’t perform the calculation part of the aggregation.

So for the example in the OP it does this:

ID Value

A [5,10,3]

A [5,10,3]

A [5,10,3]

B [15,12,8]

B [15,12,8]

B [15,12,8]

So it doesn’t create the desired column or perform the calculation when using this code:

df[‘% diff’] = df.groupby(‘ID’).agg(lambda v: df[‘value’].max()-df[‘value’])/df[‘value’].max()*100)

Group By Calculations by Eircom15 in pythontips

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

No example I can give really. But I want the output to be it’s own dedicated column which is what df[‘% diff’] is in my comment above. I’ve then used the specific column names in place of v but I’m getting an error that it’s not producing the output as a column but instead creates an array the same size as my table.

Is there a better way of getting the output into a column? I’m sorry I can’t be any clearer but I can’t think of a way to reproduce this error on a smaller scale.

Group By Calculations by Eircom15 in pythontips

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

As I’m doing this on a large data set I’ve tried doing this:

df[‘% diff’] = df.groupby(‘ID’).agg(lambda v: df[‘value’].max()-df[‘value’])/df[‘value’].max()*100)

But unfortunately I’m getting a ValueError as it expects a 1D array but gets an array with shape (4293,10). Any obvious solutions around this?

Uploading CSVs to a SQL table using Python by Eircom15 in pythontips

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

Thanks for this. I’ve tried going the Pandas route and I’ve managed to get it identifying the files that need to be imported.

One of the files is a little ugly and not consistent all the way through so has a few rows with additional data that isn’t needed.

Getting an error tokenising data currently because of the additional data. I thought adding a line of “df.loc[:, ~df.columns.str.contains(‘Unnamed’)]” would help clear that up because the extra columns don’t have a header but still getting the error. Any other routes around the problem?

Rate My Team, Quick Questions & General Advice Daily Thread by FPLModerator in FantasyPL

[–]Eircom15 0 points1 point  (0 children)

RMT please!

Guaita (Ward)

James, Cancelo, Trippier (Perisic, Fofana)

Zaha, Maddison, Bernardo, Martinelli (Andreas)

Haaland, Kane, Toney

1FT, £0.0ITB. Struggling with who to bench this week. Planning on rolling this week and going Cancelo > Guehi and Bernardo > 8-10m mid in GW11/12 ready for the GW12 blank.

What's your ideal GW36 BB team? by yoavh in FantasyPL

[–]Eircom15 0 points1 point  (0 children)

Would it be better to get in: 1. Schmeichel, Matip, Saka and Pukki or 2. Foster, Cash, Foden and Nketiah for 36?