How do I display the columns specified in the DateFrame?

use pandas"s read_csv to read a dataset

import pandas as pd

dfoff = pd.read_csv (xxx.csv", keep_default_na=False)
pd.set_option ("display.max_columns", None)
print (dfoff.head (3))

found that he has 6 columns of data

"User_id"

print(dfoff["User_id"])

User_idMerchant_id?


df [[col1, col2]] is fine

refer to this question, more specifically pandas reads some columns specified in csv
both the first and second of the above question may be helpful to you


df.loc [:, ['User_id',' Merchant_id']]

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-7b2ef4-2969b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-7b2ef4-2969b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?