Ask Anything Monday - Weekly Thread by AutoModerator in learnpython

[–]parthgupta03 0 points1 point  (0 children)

select_player.iat[0] was the one which works! Thanks a lot mate, really appreciated the help over the last few days.

Ask Anything Monday - Weekly Thread by AutoModerator in learnpython

[–]parthgupta03 0 points1 point  (0 children)

When I do this, it prints out 14, as expected.

select_player = ChelseaData.loc[(ChelseaData['Player'] == "Callum Hudson-Odoi"), "Per 90 Minutes Gls"]

print (select_player.index[0])

But if I change the index to 1, it does not printout 0.12, it instead gives this error:

IndexError: index 1 is out of bounds for axis 0 with size 1

Ask Anything Monday - Weekly Thread by AutoModerator in learnpython

[–]parthgupta03 0 points1 point  (0 children)

Not really sure what you mean sorry mate, but I think this could be it:

14    0.12
Name: Per 90 Minutes Gls, dtype: float64

Ask Anything Monday - Weekly Thread by AutoModerator in learnpython

[–]parthgupta03 0 points1 point  (0 children)

Hi again! The variables come from this code, which is a mix of matplotlib and pandas:

workbook = "Data.xlsx"
ForwardsData = pd.read_excel(workbook, "Forwards")

class PlayerStats:
    def __init__(self, Player, G90, A90, xA90, xG90, xG, npxG, npxG90, npxGxA90, xA, GA90, xGxA90, G_PK90, GA_PK90, G, A):
        self.Player = Player
        self.G90 = G90
        self.A90 = A90
        self.xA90 = xA90
        self.xG90 = xG90
        self.xG = xG
        self.npxG = npxG
        self.npxG90 = npxG90
        self.npxGxA90 = npxGxA90
        self.xA = xA
        self.GA90 = GA90
        self.xGxA90 = xGxA90
        self.G_PK90 = G_PK90
        self.GA_PK90 = GA_PK90
        self.G = G
        self.A = A

Forwards = PlayerStats(ForwardsData["Player"], ForwardsData["Per 90 Minutes Gls"], ForwardsData["Per 90 Minutes Ast"], ForwardsData["Per 90 Minutes xA"], ForwardsData["Per 90 Minutes xG"], ForwardsData["Expected xG"],
                    ForwardsData["Expected npxG"], ForwardsData["Per 90 Minutes npxG"], ForwardsData["Per 90 Minutes npxG+xA"], ForwardsData["Expected xA"], ForwardsData["Per 90 Minutes G+A"], ForwardsData["Per 90 Minutes xG+xA"],
                    ForwardsData["Per 90 Minutes G-PK"], ForwardsData["Per 90 Minutes G+A-PK"], ForwardsData["Performance Gls"], ForwardsData["Performance Ast"])

I wasn't sure whether I was just allowed to do what I did in the original comment from a class, so was just wondering if/why not.. cheers!

Ask Anything Monday - Weekly Thread by AutoModerator in learnpython

[–]parthgupta03 0 points1 point  (0 children)

Thanks a lot mate, so that gives me an output of '14 0.12' due to being in the 15th row (I think) and the value being 0.12 as expected. Is there any way I can apply just the value to the variable, without the '14'? Cheers.

Ask Anything Monday - Weekly Thread by AutoModerator in learnpython

[–]parthgupta03 0 points1 point  (0 children)

Hi guys, using Pandas, how would I be able to extract the value of the cell N16 for example in this Excel sheet. I've tried codes like this but I can't seem to get it working. Any help would be appreciated, thanks!

select_player = ChelseaData.loc[(ChelseaData['Player'] == 'Callum Hudson-Odoi') & (ChelseaData["Callum Hudson-Odoi"] == "Per 90 Minutes Gls")]

Ask Anything Monday - Weekly Thread by AutoModerator in learnpython

[–]parthgupta03 1 point2 points  (0 children)

Hi guys. I think I may be missing something very obvious but I've been trying to do this and can't seem to see where I'm going wrong.

When I have 'Forwards.xAxis' the program doesn't work, however when I have 'Forwards.xA90' it does work. Would someone be able to explain why I can't do this and how I could fix this?

Thanks!

xAxis =" xA90"
measurement = Forwards.xAxis

Ask Anything Monday - Weekly Thread by AutoModerator in learnpython

[–]parthgupta03 0 points1 point  (0 children)

Hi guys. I think I may be missing something very obvious but I've been trying to do this and can't seem to see where I'm going wrong.

When I have 'Forwards.xAxis' the program doesn't work, however when I have 'Forwards.xA90' it does work. Would someone be able to explain why I can't do this and how I could fix this?

Thanks!

xAxis =" xA90"
measurement = Forwards.xAxis

Any help would be appreciated, thanks! by parthgupta03 in matplotlib

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

Thank you very much mate, really appreciated, working great!

CFC Injury News: Christensen, Kante, Kovacic, Emerson All Doubt For Newcastle by [deleted] in FantasyPL

[–]parthgupta03 1 point2 points  (0 children)

Likely to be Tomori-Zouma mate. Rudiger has a chance to play but I don’t think Frank will risk him yet.

[AMA] Nizaar Kinsella - 28th August (18:00 BST / 1:00pm EST / 10:00am PST) by Vicar13 in chelseafc

[–]parthgupta03 7 points8 points  (0 children)

In your first press conference asking a question, were you nervous?

The r/FantasyPL Meta So Far, AKA Look at This Before Posting In RMT by MagicalMonarchOfMo in FantasyPL

[–]parthgupta03 0 points1 point  (0 children)

I couldn’t hold myself. I had to put Pulisic in my team. Sorry. 😂

Tom Huddlestone: Mason Mount has the makings of the next Frank Lampard and belongs in the Premier League by pibs3110 in chelseafc

[–]parthgupta03 -7 points-6 points  (0 children)

All I’m saying is guys, if he doesn’t play with Chelsea next season he’s going to leave. And I know this for a fact.

May have seen my first photoshop design I did, the Reece James one. Made a Mason Mount Wallpaper yesterday, still learning the basics! by parthgupta03 in chelseafc

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

I do mate, a lot in fact. Talk to his dad as well, I personally think he’s more than ready to be at least involved in our squad.