Creating, Reading and Writing $ pip install pandas $ python3 >>> import pandas as pd >>> pd.DataFrame({'BOB':['Ist column of BOB','IInd col of BoB'],'SUSE':['Ist col suse','II col suse']}) BOB SUSE 0 Ist column of BOB Ist col suse 1 IInd col of BoB II col suse >>>pd.DataFrame({..same as above---},index=['Prouct a ',' Product b']) >>> pd.Series([30, 35, 40], index=['2015 Sales', '2016 Sales', '2017 Sales'], name='Product A') 2015 Sales 30 2016 Sales 35 2017 Sales 40 Name: Product A, dtype: int64 >>> reviews=pd.read_csv('/mnt/d/wine.csv') >>> reviews show the contents of file wine.csv >>> reviews.country >>> reviews['country'] to see only country column >>> reviews.iloc[0] return only one row >>> review.il...
Comments
Post a Comment