So i have this dataframe:
dfprices = pd.DataFrame(prices)
pd.Dataframe = (
price symbol
0 0.10566500 ETHBTC
1 0.01643000 LTCBTC
2 0.00112080 BNBBTC
3 0.01423200 NEOBTC
4 0.00030000 123456
5 0.03393500 QTUMETH
6 0.01077400 EOSETH
7 0.00022600 SNTETH
8 0.00630600 BNTETH
9 0.14548000 BCCBTC
10 0.00599900 GASBTC
11 0.01059800 BNBETH
12 10294.77000000 BTCUSDT
13 1089.99000000 ETHUSDT
14 0.00142500 HSRBTC )
From this i want to
- select only the rows where the text in comlumn 'symbol' ends with 'BTC'.
- Next i want to remove 'BTC' from the strings in column 'symbol'
For this i used following code:
dfcleanprices = dfprices[dfprices['symbol'].str[-3:]=="BTC"]
dfcleanprices['symbol'] = dfcleanprices['symbol'].str[:-3]
I ge the result that i want:
pd.Dataframe = (
price symbol
0 0.10566500 ETH
1 0.01643000 LTC
2 0.00112080 BNB
3 0.01423200 NEO
9 0.14548000 BCC
10 0.00599900 GAS
14 0.00142500 HSR
19 0.00105000 MCO
20 0.00324080 WTC
22 0.00009404 LRC
24 0.00358700 QTUM)
But by executing the second statement a warning is shown:
SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead
See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy
from binance.client import Client
I tried a lot but i really need help :)