python extract columns from dataframe Posted on 2018-09-27 | Edited on 2018-07-22 | In python description: pandas select columns by name python select columns from dataframe by name123456789import pandas d = pandas.DataFrame([[1,2,3,4]], columns=['a','b','c','d'])# d# a b c d# 0 1 2 3 4d2 = d[['b','c']]# d2# b c# 0 2 3 more on search4fan.github.io Post author: killfun Post link: http://search4fan.github.io/post/python_extract_columns.html Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.