当我进行预测性建模练习时,我无法理解标志的用法。我GOOGLE了,但我找不到最好的解释。在“熊猫”中使用“flag”有什么用处
train = pd.read_csv('C:/Users/Analytics Vidhya/Desktop/challenge/Train.csv')
test = pd.read_csv('C:/Users/Analytics Vidhya/Desktop/challenge/Test.csv')
train['Type'] = 'Train' #Create a flag for Train and Test Data set
test['Type'] = 'Test'
fullData = pd.concat([train,test], axis=0) #Combined both Train and Test Data set
你能解释一下什么呢标志在Python pandas意味着,什么是标志的重要性。谢谢。
当您需要将多个数据集“concat”连接在一起,并仍能够区分哪些数据来自哪个数据集时,您最好使用哪种其他方法? – Aprillion
谢谢@Aprillion我明白了! –