You are on page 1of 7

PANDAS

To Create A Rows Or Columns Using Pandas

1.Usage of DataFrame in Pandas

But in the above picture we noticed that the column name is said as 0
as default whereas no column name is there in the series
Adding Name To the Column
We can able to add name by using dictionary and also a new
columns as our wish

We can also able to select a specific column and also a specific value
by the below picture

By mentioning the specific value we can able to get the number


which is located in the given index
In The same way we can also able to see the row by using a special
word iloc
For example: data.iloc[indexnumber]
It will just give all the details of the person

And we can also able to print or select a specific details of a person


from a row
Here in the above picture I just selected a roll no of a person and it is
printed.

Data Manipulation
Sending data’s to a csv or a text file

Our created text file in the desired location is ready


We can able to create any files using the function of
data.to_csv(‘nameofthefile.txt or csv’ )
Default the separated value is (‘,’) we can create our own separate
value by using sep=’\t’(for tab space)

And our text file is ready as per our conditions

We can also able to read the csv files we created and it can be done
but pd.read_csv and I f we print it out it will print the exact what we
have done or made changes in the csv file
We can also able to remove the extra column by giving index = False
by doing this the extra column won’t come but not in opening while
we are saving the file…
Resource Used - https://www.youtube.com/watch?
v=zN2Hua6oII0&t=998s

END OF DOCUMENT

You might also like