Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

show columns in pandas df

# Import pandas package 
import pandas as pd 
    
# making data frame 
data = pd.read_csv("nba.csv") 
    
# list(data) or
list(data.columns)
Comment

show columns

Copied mysql> SHOW COLUMNS FROM City;
+------------+----------+------+-----+---------+----------------+
| Field      | Type     | Null | Key | Default | Extra          |
+------------+----------+------+-----+---------+----------------+
| Id         | int(11)  | NO   | PRI | NULL    | auto_increment |
| Name       | char(35) | NO   |     |         |                |
| Country    | char(3)  | NO   | UNI |         |                |
| District   | char(20) | YES  | MUL |         |                |
| Population | int(11)  | NO   |     | 0       |                |
+------------+----------+------+-----+---------+----------------+
5 rows in set (0.00 sec)
Comment

show columns

mysql> SHOW COLUMNS FROM City;
+-------------+----------+------+-----+---------+----------------+
| Field       | Type     | Null | Key | Default | Extra          |
+-------------+----------+------+-----+---------+----------------+
| ID          | int(11)  | NO   | PRI | NULL    | auto_increment |
| Name        | char(35) | NO   |     |         |                |
| CountryCode | char(3)  | NO   | MUL |         |                |
| District    | char(20) | NO   |     |         |                |
| Population  | int(11)  | NO   |     | 0       |                |
+-------------+----------+------+-----+---------+----------------+
Comment

PREVIOUS NEXT
Code Example
Python :: pandas dataframe froms string 
Python :: python mixins 
Python :: calculate distance in python 
Python :: Python remove punctuation from a string 
Python :: pandas groupby mean 
Python :: networkx draw graph with weight 
Python :: install python altair 
Python :: add column to existing numpy array 
Python :: python declare array of size n 
Python :: tabula python 
Python :: pd df append 
Python :: hashing vs encryption vs encoding 
Python :: python json normalize 
Python :: python pygame how to start a game 
Python :: python replace double quotes with single quotes in string json loads 
Python :: python save dictionary 
Python :: how to get the duration of audio python 
Python :: Python Format date using strftime() 
Python :: how to import your own function python 
Python :: sciket learn imputer code 
Python :: python argparse file argument 
Python :: python typing effect 
Python :: how to get time in python 
Python :: count different values in list python 
Python :: python show charracter code 
Python :: python find string 
Python :: django render template 
Python :: try except python not working 
Python :: add caption to plot python 
Python :: discord get bot profile picture 
ADD CONTENT
Topic
Content
Source link
Name
7+2 =