Issue 1:
Code Sample

In [19]: dates = pd.period_range('20100101','20100105', freq='D')

In [20]: weights = pd.DataFrame(np.random.randn(5, 5), index=dates, columns = ['g1_%d' % x for x in range(5)])

In [21]: weights.join(pd.DataFrame(np.random.randn(5,5), index=dates, columns = ['g2_%d' % x for x in range(5)]))
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-21-2fdb8b02f5a4> in <module>()
1 weights.join(
----> 2 pd.DataFrame(np.random.randn(5,5), index=dates, columns = ['g2_%d' % x for x in range(5)]))

/usr/local/lib/python2.7/dist-packages/pandas/core/frame.pyc in join(self, other, on, how, lsuffix, rsuffix, sort)
4765 # For SparseDataFrame's benefit
4766 return self._join_compat(other, on=on, how=how, lsuffix=lsuffix,
-> 4767 rsuffix=rsuffix, sort=sort)
4768
4769 def _join_compat(self, other, on=None, how='left', lsuffix='', rsuffix='',

/usr/local/lib/python2.7/dist-packages/pandas/core/frame.pyc in _join_compat(self, other, on, how, lsuffix, rsuffix, sort)
4780 return merge(self, other, left_on=on, how=how,
4781 left_index=on is None, right_index=True,
-> 4782 suffixes=(lsuffix, rsuffix), sort=sort)
4783 else:
4784 if on is not None:

/usr/local/lib/python2.7/dist-packages/pandas/core/reshape/merge.pyc in merge(left, right, how, on, left_on, right_on, left_index, right_index, sort, suffixes, copy, indicator)
52 right_index=right_index, sort=sort, suffixes=suffixes,
53 copy=copy, indicator=indicator)
---> 54 return op.get_result()
55
56

/usr/local/lib/python2.7/dist-packages/pandas/core/reshape/merge.pyc in get_result(self)
567 self.left, self.right)
568
--> 569 join_index, left_indexer, right_indexer = self._get_join_info()
570
571 ldata, rdata = self.left._data, self.right._data

/usr/local/lib/python2.7/dist-packages/pandas/core/reshape/merge.pyc in _get_join_info(self)
720 join_index, left_indexer, right_indexer = \
721 left_ax.join(right_ax, how=self.how, return_indexers=True,
--> 722 sort=self.sort)
723 elif self.right_index and self.how == 'left':
724 join_index, left_indexer, right_indexer = \

TypeError: join() got an unexpected keyword argument 'sort'

It seems the sort kwarg is invalid, but the internals are passing it in regardless

Output of pd.show_versions()

In [22]: pd.show_versions()
/usr/local/lib/python2.7/dist-packages/xarray/core/formatting.py:16: FutureWarning: The pandas.tslib module is deprecated and will be removed in a future version.
from pandas.tslib import OutOfBoundsDatetime

INSTALLED VERSIONS

commit: None

python: 2.7.12.final.0

python-bits: 64

OS: Linux

OS-release: 4.9.13-moby

machine: x86_64

processor: x86_64

byteorder: little

LC_ALL: None

LANG: None

LOCALE: None.None

pandas: 0.20.1

pytest: 3.0.7

pip: 9.0.1

setuptools: 35.0.2

Cython: 0.25.2

numpy: 1.12.1

scipy: 0.19.0

xarray: 0.9.2

IPython: 5.3.0

sphinx: None

patsy: 0.4.1

dateutil: 2.6.0

pytz: 2017.2

blosc: None

bottleneck: 1.2.0

tables: None

numexpr: 2.6.2

feather: None

matplotlib: 2.0.1

openpyxl: None

xlrd: None

xlwt: 1.2.0

xlsxwriter: None

lxml: None

bs4: None

html5lib: 0.999999999

sqlalchemy: 1.1.9

pymysql: None

psycopg2: None

jinja2: 2.9.6

s3fs: None

pandas_gbq: 0.1.6

pandas_datareader: None

Issue 2:
I've run into a data-dependent bug with MultiIndex. Attached are a test script and a data file generation script:

sales-data.py loads CSV data from a CSV data file with read_csv and then displays a multiindexed subset.

sales-gen.sh is an AWK script that generates CSV test files. By default, it creates a 600MB file, which causes the failure. To make a smaller test file, which succeeds, just use "head -1000".

My problem is that sales-data.py breaks with large CSV files but works with smaller CSV files. When it fails it displays the following error message:

'MultiIndex lexsort depth 0, key was length 4'

I know that MultiIndexes must be pre-sorted. So sales-gen.sh makes sure that the first four columns in the auto-generated CSV files are ordered. BTW, I'm not sure why lexsort is getting called.

sales-data.py

#!/usr/bin/env python

import numpy as np
import pandas as pd
from memory_profiler import profile

pd.set_option('display.height', 400)
pd.set_option('display.width', 400)
pd.set_option('display.max_rows', 1000)
pd.set_option('display.max_columns', 30)
pd.set_option('display.line_width', 200)

# @profile
def load_data():
try:
df = pd.read_csv(
'./sales-large.csv',
# './sales-small.csv',
header = None,
na_values = ['NULL'],
names = [
'salesperson',
'customer',
'invoice_date',
'ship_date',
'product',
'quantity',
'price',
],
index_col = [
'salesperson',
'customer',
'invoice_date',
'ship_date',
],
parse_dates = [
'invoice_date',
'ship_date',
],
)

print(df.loc[(
'A00000', # salesperson
'A', # customer
pd.datetime(2011,3,1,0,0,0), # invoice_date
pd.datetime(2011,3,6,0,0,0), # ship_date
)])

except Exception as e:
print(e)

if __name__== '__main__':
load_data()

sales-gen.sh

#!/usr/bin/env bash

# 'salesperson',
# 'customer',
# 'invoice_date',
# 'ship_date',
# 'product',
# 'quantity',
# 'price',

awk "BEGIN { \
first = 65; \
last = 91; \
s_char = first; \
c_char = first; \
\
n_sa = 100; \
n_cu = 100; \
n_dt = 10; \
n_pr = 100; \
\
for (i = 0; i < n_sa; i++ s_char++) { \
if (s_char == last) { \
s_char = first; \
} \
c_char = first; \
for (j = 0; j < n_cu; j++ c_char++) { \
if (c_char == last) { \
c_char = first; \
} \
for (k = 1; k <= n_dt; k++) { \
for (l = 0; l < n_pr; l++) { \
printf(\"%c%05d,%c,2011-03-%02d 00:00:00,2011-03-%02d 00:00:00,%d,%d,%f\n\", \
s_char, i, c_char, k, k+5, l, 1 + int(rand() * 10), rand()) \
} \
} \
} \
} \
}"