Jerry Xue Jerry Xue - 1 year ago 99
Python Question

mask_missing is not defined in pandas.core.common?

Recently I installed zipline with Anaconda, together with it is pandas 0.18.1. When I tried to import zipline, it reports following error:


C:\Anaconda3\envs\helloworld\lib\site-packages\zipline\utils\munge.py in <module>()

13 # See the License for the specific language governing permissions and

14 # limitations under the License.

---> 15 from pandas.core.common import mask_missing

16 try:

17 from pandas.core.common import backfill_2d, pad_2d

ImportError: cannot import name 'mask_missing'


Then I checked Pandas pandas.core.common.py source code, mask_missing is not defined there. May I know which version of Pandas we should use?




I found this online: http://nullege.com/codes/show/src%40p%40a%40pandas-0.13.1%40pandas%40core%40generic.py/53/pandas.core.common.mask_missing/python

It seems like in pandas 0.13 mask_missing is still there. I will downgrade pandas to 0.13 first and see if it solves problem

Answer Source

From the zipline git repository, it looks like you need 0.16.1 of pandas, based upon this line: https://github.com/quantopian/zipline/blob/master/etc/requirements.txt#L17

Going back to that release in the pandas repository, that function is indeed there: https://github.com/pydata/pandas/blob/v0.16.1/pandas/core/common.py#L497