Issue 1:
The shift method in SparseDataFrame does not respond to axis correctly.

>>> import pandas as pd
>>> import numpy as np
>>> df = pd.SparseDataFrame(np.random.rand(10,5))
>>> df.shift(1)
0 1 2 3 4
0 NaN NaN NaN NaN NaN
1 0.015673 0.456047 0.451249 0.297851 0.178720
2 0.393355 0.594275 0.496614 0.936675 0.311961
3 0.255445 0.141111 0.750324 0.994727 0.965763
4 0.473577 0.644481 0.584495 0.796462 0.689525
5 0.744432 0.918232 0.715706 0.672892 0.598817
6 0.732707 0.110259 0.756422 0.534970 0.449421
7 0.340564 0.907769 0.543032 0.214241 0.564122
8 0.291026 0.616647 0.102853 0.940241 0.693239
9 0.445545 0.760656 0.035569 0.398808 0.050392

[10 rows x 5 columns]
>>> df.shift(1,axis=1)
0 1 2 3 4
0 NaN NaN NaN NaN NaN
1 0.015673 0.456047 0.451249 0.297851 0.178720
2 0.393355 0.594275 0.496614 0.936675 0.311961
3 0.255445 0.141111 0.750324 0.994727 0.965763
4 0.473577 0.644481 0.584495 0.796462 0.689525
5 0.744432 0.918232 0.715706 0.672892 0.598817
6 0.732707 0.110259 0.756422 0.534970 0.449421
7 0.340564 0.907769 0.543032 0.214241 0.564122
8 0.291026 0.616647 0.102853 0.940241 0.693239
9 0.445545 0.760656 0.035569 0.398808 0.050392

[10 rows x 5 columns]
>>>

Using Pandas version 0.13.1

Issue 2:
Code Sample

import pandas as pd
import StringIO

# Store the csv string in a variable
gps_string = """
"2010-01-12 18:00:00","$GPGGA","180439","7249.2150","N","11754.4238","W","2","10","0.9","-8.1","M","-12.4","M","","*57","","",""
"2010-01-12 17:30:00","$GPGGA","173439","7249.2160","N","11754.4233","W","2","11","0.8","-4.5","M","-12.4","M","","*5B","","",""
"2010-01-12 17:00:00","$GPGGA","170439","7249.2152","N","11754.4235","W","2","11","0.8","-3.1","M","-12.4","M","","*5C","","",""
"2010-01-12 16:30:00","N","11754.4210","W","2","09","1.1","-13.1","M","-12.4","M","","*6C","","","","","",""
"2010-01-12 16:00:00","N","11754.4229","W","2","10","0.9","-2.9","M","-12.4","M","","*53","","","","","",""
"2010-01-12 15:30:00","N","11754.4269","W","2","09","0.8","-4.3","M","-12.4","M","","*54","","","","","",""
"2010-01-12 15:00:00","N","11754.4267","W","2","10","0.8","-1.6","M","-12.4","M","","*56","","","","","",""
"2010-01-12 14:30:00","$GPGGA","143439","7249.2152","N","11754.4253","W","2","11","0.7","-4.3","M","-12.4","M","","*56","","",""
"2010-01-12 14:00:00","N","11754.4245","W","2","10","0.9","-7.0","M","-12.4","M","","*50","","","","","",""
"2010-01-12 13:30:00","$GPGGA","133439","7249.2134","N","11754.4243","W","2","11","0.7","-10.7","M","-12.4","M","","*61","","",""
"2010-01-12 13:00:00","N","11754.4245","W","2","10","0.8","-5.5","M","-12.4","M","","*56","","","","","",""
"2010-01-12 12:30:00","N","11754.4226","W","2","10","0.9","-7.1","M","-12.4","M","","*59","","","","","",""
"2010-01-12 12:00:00","N","11754.4238","W","2","10","0.8","-6.5","M","-12.4","M","","*51","","","","","",""
"2010-01-12 11:30:00","N","11754.4227","W","2","10","0.8","0.1","M","-12.4","M","","*73","","","","","",""
"2010-01-12 11:00:00","-7.4","M","-12.4","M","","*5F","","","","","","","","","","","",""
"2010-01-12 10:30:00","N","11754.4271","W","2","08","1.1","-8.4","M","-12.4","M","","*5A","","","","","","" """

# Read the csv string into a dataframe.
gps_df = pd.read_csv(StringIO.StringIO(gps_string), header=None, index_col=0)
rows_to_shift = gps_df[gps_df[15].isnull()].index
gps_df.loc[rows_to_shift] = gps_df.loc[rows_to_shift].shift(periods=1, axis=1)
# create this file to see the outcome
gps_df.to_csv("f.csv")

Problem description

I am trying to use the Dataframe. shift() function to move certain rows of data into their correct columns, and the Dataframe.shift() function is doing some weird things, it is creating an empty column of null(s) and moves one of the columns to the end of the dataframe.

Screenshots

Original data:

Output after execution of the code

As seen above, the data that was originally in column 10 has been move to column 15 for some reason. Also a column with null values has been created in column 6.

I expect that the data should be moved to the right by one step, that is the data in each column should move to the column to the left of it, and the current behaviour is confusing, based on the documentation of what this function should do.

My expected output:

Output of pd.show_versions()

INSTALLED VERSIONS

commit: None

python: 2.7.14.final.0

python-bits: 32

OS: Windows