Skip to content

Networkx: Network graph from pandas dataframe

I have the following dataset: The dataframe shows when different investment firms have invested in the same Company during a year. I want to create a network graph of the Connections between the Firm_ID only. For example Ampersand and BancBoston have both invested in the same company and should therefore be c…

Can’t Make Code Detect whose turn it is in Python IDLE

My friend and I are trying to code the “21” game into Python, where you play against a random thingy and you take in turns adding numbers (from 1-4) to a score and if its 21 or above when its your turn, you lose. but we can’t figure out how to make it detect who’s turn it was when it

deleting a label after a given time period

I am trying to delete a label after a given time period but I am getting an error which I understand here’s the code which is giving the error and heres the error how can I delete the label ?? Answer As the error said, the label has already been destroyed when update() is triggered/executed by .after().…

Can’t install alpaca_trade_api

I tried using pip install alpaca_trade_api and it errored out with exit status 1. I also tried pip install alpaca-trade-api and it had the same errors. I get a ton of errors including this one: Additionally the command takes forever to run. I think this may have to do with me upgrading pip and pip3 and accide…

Get only numbers at the end (regex)

I’d like to get only the numbers (integers) at the end of the phrases below: I mean: 600, 1400, 100000. I’ll add each one of them to a database later. I tried to use regex: (?<=s)(d*s*)|(d*.d*)$ But it didn’t work properly. Any ideas? PS: We use dots, not commas to represent a thousand: 1…