Categories
Development

Curious unapply of function with pool.map( func , iterable ) with pandas.DataFrame

Linked to this problematic , I use this method on a sample of the dataframe to see if it does the thing right, and it is the case as the following: m = dfsample.Result.eq(‘Win’) s = m.shift().cumsum() dfsample[‘gap_in_days’] = dfsample.groupby([‘name’, s])[‘Gap done’].cumsum() #”Expected Gap” in the linked topic dfsample[‘nb_of_games’] = dfsample.assign(nb_of_games = 1).groupby(‘name’)[‘nb_of games’].apply(lambda x:x.shift().cumsum()).fillna(0) […]

Categories
Development

Pyqtgraph candlestick

I used this code: https://github.com/pyqtgraph/pyqtgraph/blob/develop/examples/customGraphicsItem.py I replaced data with a file.csv The lines are written this way: 2019-11-07 21:40:00+00:00,9190.5,36024221.0,9200.0,3922.7451237799987,1067.0,9169.0,9180.5,XBTUSD,6202,392274512378,36024221,9183.5798 timestamp,close,foreignNotional,high,homeNotional,lastSize,low,open,symbol,trades,turnover,volume,vwap I would like to know how to get the date on the x-axis. For the moment I use: self.x = [i for i in range (len(self.open))] and w = 1/3 Exemple : import sys from […]