In [1]:
import pandas as pd

In [7]:
iris=pd.read_csv("http://vincentarelbundock.github.io/Rdatasets/csv/datasets/iris.csv",header=None)

In [8]:
iris.head()


Out[8]:
0 1 2 3 4 5
0 NaN Sepal.Length Sepal.Width Petal.Length Petal.Width Species
1 1.0 5.1 3.5 1.4 0.2 setosa
2 2.0 4.9 3 1.4 0.2 setosa
3 3.0 4.7 3.2 1.3 0.2 setosa
4 4.0 4.6 3.1 1.5 0.2 setosa

In [10]:
iris2=iris.iloc[1:,1:]

In [11]:
iris2.head()


Out[11]:
1 2 3 4 5
1 5.1 3.5 1.4 0.2 setosa
2 4.9 3 1.4 0.2 setosa
3 4.7 3.2 1.3 0.2 setosa
4 4.6 3.1 1.5 0.2 setosa
5 5 3.6 1.4 0.2 setosa

In [12]:
import os as os

In [13]:
os.getcwd()


Out[13]:
'C:\\Users\\Dell\\Documents'

In [18]:
iris2.to_csv("iris2.csv")

In [4]:
iris.info()


<class 'pandas.core.frame.DataFrame'>
RangeIndex: 150 entries, 0 to 149
Data columns (total 6 columns):
Unnamed: 0      150 non-null int64
Sepal.Length    150 non-null float64
Sepal.Width     150 non-null float64
Petal.Length    150 non-null float64
Petal.Width     150 non-null float64
Species         150 non-null object
dtypes: float64(4), int64(1), object(1)
memory usage: 7.1+ KB

CREATE TABLE iris ( Sepal_Length real, Sepal_Width real, Petal_Length real, Petal_Width real, Species varchar(20)
);


In [19]:
os.getcwd()


Out[19]:
'C:\\Users\\Dell\\Documents'

In [20]:
os.chdir('C:\\Users\\Dell\\Desktop')

In [21]:
os.listdir()


Out[21]:
['.Rhistory',
 '16508797_10155115909410362_414170078812994931_n.jpg',
 '27032014_Duplicate_Statement.pdf',
 '30072015_form_du-degree.pdf',
 'ACK.html',
 'ACK_files',
 'adult.data.txt',
 'AJAY.xps',
 'Basics of SQL & RDBMS _ Must Skills For Data Science Professionals.html',
 'Basics of SQL & RDBMS _ Must Skills For Data Science Professionals_files',
 'BigDiamonds (2).csv',
 'BigDiamonds.csv',
 'BigDiamonds.csv (2).zip',
 'BigDiamonds2.csv',
 'BLOOD REPORT.pdf',
 'CAM- Ajay Ohri.pdf',
 'cam.xps',
 'cam2.pdf',
 'cdo.jpeg',
 'clustersas.html',
 'dap class 4.R',
 'dap_class_4.html',
 'desktop.ini',
 'Dropbox.lnk',
 'dupform.pdf',
 'DVD.csv',
 'GermanCredit.csv',
 'Git Shell.lnk',
 'GitHub.appref-ms',
 'GoToMeeting.lnk',
 'groceries.csv',
 'Guidelines-CBSE.html',
 'IMS proschool',
 'iris2.csv',
 'logistic regression - script for ppt.R',
 'OnlineCardNSR.pdf',
 'PaymentForm.pdf',
 'Program 1-results.rtf',
 'Rdatasets',
 'Results_ Modeling and Forecasting.html',
 'Results_ Program 5.sas.html',
 'Results_ Time Series Exploration.ctk.html',
 'Rplot.png',
 'Rplot01.pdf',
 'Rplot02.pdf',
 'Rplot03.png',
 'rsconnect',
 'sas-university-edition-107140.pdf',
 'SQL-1.png',
 'sql.jpg',
 'sqlcheatsheet.jpg',
 'sqljoins_cheatsheet.png',
 'Sunstone - Google Docs.pdf',
 'test',
 'Trarscript_Form.pdf']

In [ ]: