Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/357.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我正在将一个函数集成到python 2代码中,它显示了一个语法错误:函数参数处的语法无效_Python_Python 2.7_Function_Syntax Error - Fatal编程技术网

我正在将一个函数集成到python 2代码中,它显示了一个语法错误:函数参数处的语法无效

我正在将一个函数集成到python 2代码中,它显示了一个语法错误:函数参数处的语法无效,python,python-2.7,function,syntax-error,Python,Python 2.7,Function,Syntax Error,我正在将一个函数集成到python 2代码中,它显示了一个语法错误:函数参数处的语法无效 这里是函数 def remove_federal_email_records(df_inv_file: pd.DataFrame, email_column: str, usf_master_file: str) -> pd.DataFrame: '''

我正在将一个函数集成到python 2代码中,它显示了一个语法错误:函数参数处的语法无效

这里是函数

def remove_federal_email_records(df_inv_file: pd.DataFrame,
                                 email_column: str,
                                 usf_master_file: str) -> pd.DataFrame:
    '''
    Remove records based on Federal domain emails.
    Records will be filtered using the US Federal e-mail master file.
    :param df_inv_file: A dataframe containing invite file data. It will be
    filtered using this function.
    :param column_name: The column which contains the email address.
    :param usf_master_file: The location of a .CSV file containing data with
    the US federal email domains in the first column.
    :returns: A pandas dataframe containing only the records with the approved
     countries.
    '''

这里是错误信息

bash: no job control in this shell
Traceback (most recent call last):
  File "/home/mesadmin/ucd-test-home/Offerings_ODS/python/OfferingWebAppHandler.py", line 18, in <module>
    import OfferingProcessInvite
  File "/home/mesadmin/ucd-test-home/Offerings_ODS/python/OfferingProcessInvite.py", line 324
    def remove_federal_email_records(df_inv_file: pd.DataFrame,
                                                ^
SyntaxError: invalid syntax
bash:此shell中没有作业控件
回溯(最近一次呼叫最后一次):
文件“/home/mesadmin/ucd test home/offices_ODS/python/OfferingWebAppHandler.py”,第18行,在
导入OfferingProcessInvite
文件“/home/mesadmin/ucd test home/offices\u ODS/python/offeringprocessinite.py”,第324行
def删除联邦电子邮件记录(df_inv_文件:pd.DataFrame,
^
SyntaxError:无效语法

感谢阅读

看起来您正在python 2中使用python 3类型的注释。请看这里:谢谢您的帮助,但由于我正在尝试将python 3 def复制到python 2中,现在我收到了以下错误lol“”’信息:OfferingProcessInvite:>>开始固定值函数信息:OfferingProcessInvite:>>开始固定值函数信息:OfferingProcessInvite:>>>启动单独的\u记录函数错误:\u\u主\u:'module'对象没有属性'dataframe''