Answers for "how to get list of column names in pandas"

1

how to find columns of a dataframe

list(my_dataframe.columns.values)
Posted by: Guest on June-23-2020
1

pandas dataframe column names

print(data.columns.values)
Posted by: Guest on January-25-2021
0

get column names as list

public static List<String> getColumnNames(){


        List<String> columnList = new ArrayList<>();
        try {
            ResultSetMetaData rsMetaData = rs.getMetaData();
            for (int colNum = 1; colNum < getColumnCount()  ; colNum++) {
                columnList.add(rsMetaData.getColumnLabel(colNum));
            }
        } catch (SQLException e) {
       System.out.println("ERROR WHILE GETTING COLUMN NAMES "+ e.getMessage());
        }

        return columnList;
    }
Posted by: Guest on November-30-2020

Code answers related to "how to get list of column names in pandas"

Python Answers by Framework

Browse Popular Code Answers by Language