Skip to content

Instantly share code, notes, and snippets.

@adxrgh
Created May 22, 2017 17:15
Show Gist options
  • Save adxrgh/9808ed8c4f966abe957c502fe66135e6 to your computer and use it in GitHub Desktop.
Save adxrgh/9808ed8c4f966abe957c502fe66135e6 to your computer and use it in GitHub Desktop.
[double charts]
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import datetime as dt
from pandas import Series,DataFrame
from datetime import datetime
from dateutil.parser import parse
import time
from pandas.tseries.offsets import Hour,Minute,Day,MonthEnd
import pytz
import random;random.seed(0)
import string
from numpy.random import rand
import pandas_datareader as web
import matplotlib
matplotlib.style.use('ggplot')
hk2=pd.read_excel('d:/bbb.xlsx').iloc[::-1]
hk1=hk2.set_index('截止时间')
hk3=hk1.shift(1)
hk=hk1-hk3
hk.iloc[0,:]=hk2.iloc[0,:]
hk.index=hk1.index
hk=hk.rename(columns={'累计汇入金额':'单月销售额'})
hk=hk.rename(columns={'累计汇出金额':'单月赎回额'})
hk=hk.rename(columns={'累计净汇入金额':'单月净销额'})
hk['单月赎回']=-1*hk['单月赎回额']
del hk['单月赎回额']
hk=hk[['单月销售额','单月赎回','单月净销额']]
fig=plt.figure()
ax=hk[['单月销售额','单月赎回']].plot.bar()
ax2=ax.twinx()
ax2.plot(ax.get_xticks(),hk['单月净销额'],color='black')
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment