Stack Exchange
multiply different dataframe column labels / index lenght
I would like to multiply the two following dataframe:
df1:
currency
BTC       151.747134
ETH       612.943278
XRP    876533.361796

df2:
               balance
currency              
BCH       3.110515e+04
BTC       1.249170e+06
ETH       4.332074e+04
XRP       3.081000e+01
QASH      4.565000e+00
AUD       7.104848e-01
CNY       1.433651e-01
EUR       1.174428e+00
HKD       1.283253e-01
IDR       5.674280e-05
INR       1.334581e-02
JPY       9.441869e-03
PHP       2.033362e-02
SGD       7.227208e-01
USD       1.000000e+00

I know that the two df columns names do not match. I tried the following code:
df2.rename(columns=['df1_column_name']) * df1

error:
items = [func(x) for x in index]
TypeError: 'list' object is not callable

I am only interested in the index located in the first dataframe for the output. Any help would be appreciated.

Could you add expected output of the example above as well?

You can multiple 2 Series by Series.mul, second DataFrame select by column name for Series and for index only by df1.index add Series.reindex:
print (type(df1))
<class 'pandas.core.series.Series'>

print (type(df2))
<class 'pandas.core.frame.DataFrame'>

s = df1.mul(df2['balance'].reindex(df1.index))
print (s)
currency
BTC    1.895580e+08
ETH    2.655316e+07
XRP    2.700599e+07
dtype: float64

