def df_add(self,column,added_info):
'''
Args
column (string):
the column name to be played with
added_info (string, int, float or pandas.DataFrame):
The information to be added to the selected column can be string, int, float, or
pandas.DataFrame
Returns
-
'''
if isinstance(added_info,str):
self.data_df[column] = self.data_df[column] + self.data_df[added_info]
elif isinstance(added_info,(int,float)):
self.data_df[column] = self.data_df[column] + added_info
elif isinstance(added_info,(pd.Series,pd.DataFrame)):
self.data_df[column] = self.data_df[column] + added_info
# This function performs minus to a given column
评论列表
文章目录