Issue 1:
Code Sample, a copy-pastable example if possible

"""Bug pandas."""
from pandas import read_csv, to_datetime

try:
from StringIO import StringIO
except ImportError:
from io import StringIO

dtf = read_csv(StringIO('Time, Value\n'
'2017-11-08 15:14:04.421,1\n'
'2017-11-08 15:14:05.528,2\n'
'2017-11-08 15:14:06.714,3\n'
'2017-11-08 15:14:07.113,4\n'
'2017-11-08 15:14:08.282,5\n'
'2017-11-08 15:14:08.681,6\n'
'2017-11-08 15:14:10.650,7\n'
'2017-11-08 15:14:11.826,8\n'
'2017-11-08 15:14:12.225,9\n'
'2017-11-08 15:14:13.416,10'))

dtf.Time = to_datetime(dtf.Time)
dtf.set_index('Time', inplace=True)
print(dtf)
dtf2 = dtf.resample('1s').bfill(limit=1)
print(dtf2)

Problem description

Current output:

Value
Time
2017-11-08 15:14:04 1.0
2017-11-08 15:14:05 2.0
2017-11-08 15:14:06 3.0
2017-11-08 15:14:07 4.0
2017-11-08 15:14:08 5.0
2017-11-08 15:14:09 NaN
2017-11-08 15:14:10 7.0
2017-11-08 15:14:11 8.0
2017-11-08 15:14:12 9.0
2017-11-08 15:14:13 10.0

Main issue: NaN is not expected.

Secondary minor issue:

bfill with limit is changing type of the column, bfill without limit is not changing the dtype

Expected Output

Value
Time
2017-11-08 15:14:04 1
2017-11-08 15:14:05 2
2017-11-08 15:14:06 3
2017-11-08 15:14:07 4
2017-11-08 15:14:08 5
2017-11-08 15:14:09 6
2017-11-08 15:14:10 7
2017-11-08 15:14:11 8
2017-11-08 15:14:12 9
2017-11-08 15:14:13 10

Output of pd.show_versions()

INSTALLED VERSIONS

commit: None

python: 2.7.13.final.0

python-bits: 64

OS: Darwin

OS-release: 17.3.0

machine: x86_64

processor: i386

byteorder: little

LC_ALL: None

LANG: None

LOCALE: None.None

pandas: 0.22.0

pytest: None

pip: 9.0.1

setuptools: 34.3.0

Cython: None

numpy: 1.14.0

scipy: None

pyarrow: None

xarray: None

IPython: None

sphinx: None

patsy: None

dateutil: 2.6.1

pytz: 2017.3

blosc: None

bottleneck: None

tables: None

numexpr: None

feather: None

matplotlib: None

openpyxl: None

xlrd: None

xlwt: None

xlsxwriter: None

lxml: None

bs4: None

html5lib: None

sqlalchemy: None

pymysql: None

psycopg2: None

jinja2: 2.9.5

s3fs: None

fastparquet: None

pandas_gbq: None

pandas_datareader: None

None

Issue 2:
If a dataframe has a single row for a given index entry, it returns a Series. If it

has two rows for that index, it returns a DataFrame. I believe that it should return a

DataFrame in either case for consistency.

Image attached, small dataframe and notebook exhibiting the problem attached. OK, so

I can't attach either the dataframe or the notebook, even suffixing them with .txt (github barfs).

So I'm pasting the text fragment after the image..

dataframe = '''

Locus,Decision,Group,Var,Region,Gene,Rows,Mutation,Profile

chr01:0018961727,Homopolymer,VS,CA,exonic,PAX7,1.0,synonymous SNV,000000010010001000000000001101

chr01:0027057772,Bad,IR-PM-VS,CA,exonic,ARID1A,1.0,nonsynonymous SNV,000000000000000000001000100000

chr01:0027057772,Bad,IR-PM-VS,CA,exonic,ARID1A,1.0,nonsynonymous SNV,000000000000000000011001110100

chr01:0027057772,Bad,IR-PM-VS,CA,exonic,ARID1A,1.0,nonsynonymous SNV,100000000001010000010001110110

'''

df = [line.split(',') for line in txt.split('\n')]

tdf = pd.DataFrame.from_records(df, index=(0,))

tdf

type(tdf.loc['chr01:0018961727']), type(tdf.loc['chr01:0027057772'])