miaohancheng / pysmatch

Propensity Score Matching(PSM) on python
MIT License
94 stars 20 forks source link

'DataFrame' object has no attribute 'append' #1

Open xiaohuangdudu123 opened 6 days ago

xiaohuangdudu123 commented 6 days ago

你好~,我这边按照案例的代码跑会报这个错AttributeError: 'DataFrame' object has no attribute 'append',这个我看了一下是因为pandas版本2以上删除了这个功能函数。但是我的python是企业认证的版本一直装不了pandas2以下的。如果有修复相关的,就太感谢了呜呜呜

xiaohuangdudu123 commented 6 days ago

主要在执行m = Matcher(test, control, yvar="loan_status", exclude=[])的时候

AttributeError Traceback (most recent call last) Cell In[4], line 1 ----> 1 m = Matcher(test, control, yvar="loan_status", exclude=[])

File ~\PycharmProjects\pythonProject.venv\Lib\site-packages\pysmatch\Matcher.py:39, in Matcher.init(self, test, control, yvar, formula, exclude) 37 c = c.dropna(axis=1, how="all") 38 c.index += len(t) ---> 39 self.data = t.dropna(axis=1, how='all').append(c.dropna(axis=1, how='all'), sort=True) 40 self.control_color = "#1F77B4" 41 self.test_color = "#FF7F0E"

File ~\PycharmProjects\pythonProject.venv\Lib\site-packages\pandas\core\generic.py:6299, in NDFrame.getattr(self, name) 6292 if ( 6293 name not in self._internal_names_set 6294 and name not in self._metadata 6295 and name not in self._accessors 6296 and self._info_axis._can_hold_identifiers_and_holds_name(name) 6297 ): 6298 return self[name] -> 6299 return object.getattribute(self, name)

AttributeError: 'DataFrame' object has no attribute 'append'

miaohancheng commented 2 days ago

好的,我会关注一下

xiaohuangdudu123 commented 2 days ago

您的邮件我已经收到啦!

miaohancheng commented 2 days ago

可以测试一下新版本 pysmatch-0.1

miaohancheng commented 1 day ago

@xiaohuangdudu123 改动比较大,看看是否满足你的需求,最新版本v0.2