<?xml version="1.0" encoding="UTF-8"?>        <rss version="2.0"
             xmlns:atom="http://www.w3.org/2005/Atom"
             xmlns:dc="http://purl.org/dc/elements/1.1/"
             xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
             xmlns:admin="http://webns.net/mvcb/"
             xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
             xmlns:content="http://purl.org/rss/1.0/modules/content/">
        <channel>
            <title>
									Consider the following Employee.csv file : - Python				            </title>
            <link>https://discuss.codewithbishal.com/python/consider-the-following-employee-csv-file/</link>
            <description>Discuss Discussion Board</description>
            <language>en-US</language>
            <lastBuildDate>Mon, 27 Apr 2026 18:23:46 +0000</lastBuildDate>
            <generator>wpForo</generator>
            <ttl>60</ttl>
							                    <item>
                        <title>Answer to: Consider the following Employee.csv file :</title>
                        <link>https://discuss.codewithbishal.com/python/consider-the-following-employee-csv-file/#post-33</link>
                        <pubDate>Mon, 21 Nov 2022 20:01:58 +0000</pubDate>
                        <description><![CDATA[1) WAP to display the shape of employee.csv file.

Code:
import pandas as pd

data = pd.read_csv(&quot;path-of-file.csv&quot;)

print(&quot;shape of employee.csv file: &quot;)

print(csvData.shape)
Ou...]]></description>
                        <content:encoded><![CDATA[<blockquote>
<p>1) WAP to display the shape of employee.csv file.</p>
</blockquote>
<p>Code:</p>
<pre contenteditable="false">import pandas as pd

data = pd.read_csv("path-of-file.csv")

print("shape of employee.csv file: ")

print(csvData.shape)</pre>
<p>Output:</p>
<pre contenteditable="false">shape of employee.csv file:
(8, 5)</pre>
<blockquote>
<p><span>2. WAP to display Name, Age and Salary from employee.csv</span></p>
</blockquote>
<div>
<p>Code:</p>
<pre contenteditable="false">import pandas as pd


data= pd.read_csv("path-of-file.csv",usecols=)


print(data)</pre>
<p>Output:</p>
<pre contenteditable="false">  Name Age Salary
0 Ritesh 25.0 15000.0
1 Akash 26.0 16000.0
2 NaN NaN NaN
3 Mahima 27.0 20000.0
4 Lakshay 28.0 18000.0
5 Manu 25.0 25000.0
6 Nidhi 26.0 NaN
7 Geetu 30.0 28000.0</pre>
</div>
<blockquote>
<div>
<p>3. WAP to display only 5 records from employee.csv.</p>
</div>
</blockquote>
<div>
<p>Code:</p>
<pre contenteditable="false">import pandas as pd


data= pd.read_csv("path-of-file.csv")


print(data.head(5))</pre>
<p>Output:</p>
<pre contenteditable="false">  empid Name Age City Salary
0 100.0 Ritesh 25.0 mumbai 15000.0
1 101.0 Akash 26.0 Goa 16000.0
2 NaN NaN NaN NaN NaN
3 102.0 Mahima 27.0 Hyderabad 20000.0
4 103.0 Lakshay 28.0 Delhi 18000.0</pre>
</div>
<blockquote>
<p>4. WAP to display records without header.</p>
</blockquote>
<div>
<p>Code:</p>
<pre contenteditable="false">import pandas as pd


data = pd.read_csv("path-of-file.csv", header=None)


print(data)</pre>
<p>Output:</p>
<pre contenteditable="false">  0     1    2   3    4
0 empid Name Age City Salary
1 100 Ritesh 25 mumbai 15000
2 101 Akash 26 Goa 16000
3 NaN NaN NaN NaN NaN
4 102 Mahima 27 Hyderabad 20000
5 103 Lakshay 28 Delhi 18000
6 104 Manu 25 Mumbai 25000
7 105 Nidhi 26 Delhi NaN
8 106 Geetu 30 Bangaluru 28000</pre>
<blockquote>
<p>5. WAP to display employee.csv file without index numbers.</p>
</blockquote>
</div>
<div>
<p>Code:</p>
<pre contenteditable="false">import pandas as pd


data = pd.read_csv("path-of-file.csv")


print(data.to_string(index=False))</pre>
<p>Output:</p>
<pre contenteditable="false">empid Name Age City Salary
100.0 Ritesh 25.0 mumbai 15000.0
101.0 Akash 26.0 Goa 16000.0
NaN NaN NaN NaN NaN
102.0 Mahima 27.0 Hyderabad 20000.0
103.0 Lakshay 28.0 Delhi 18000.0
104.0 Manu 25.0 Mumbai 25000.0
105.0 Nidhi 26.0 Delhi NaN
106.0 Geetu 30.0 Bangaluru 28000.0</pre>
<blockquote>
<p>6. WAP to display employee.csv file with new column names.</p>
</blockquote>
</div>
<div>
<pre contenteditable="false">import pandas as pd


data = pd.read_csv("path-of-file.csv", names=)


print(data)</pre>
<blockquote>
<p>7. WAP to modify the employee name from Mahima to Harsh.</p>
</blockquote>
</div>
<pre contenteditable="false">import pandas as pd

data = pd.read_csv("path-of-file.csv")

df = pd.DataFrame(data)

df = df.replace("Mahima", "Harsh")

print(df)</pre>
<blockquote>
<p>8. WAP to create a new CSV file by copying the contents of employee.csv.</p>
</blockquote>
<pre contenteditable="false">import pandas as pd

data = pd.read_csv("path-of-file.csv")

df = pd.DataFrame(data)

df.to_csv(""path-of-file-2.csv)

print(df)</pre>
<blockquote>
<p>9. WAP to create a duplicate file for employee.csv containing Empid and Employee Name.</p>
</blockquote>
<pre contenteditable="false">import pandas as pd

data = pd.read_csv("path-of-file.csv", usecols=)

df = pd.DataFrame(data)

df.to_csv("path-of-file.csv-2", header=)

print(df)</pre>]]></content:encoded>
						                            <category domain="https://discuss.codewithbishal.com/python/">Python</category>                        <dc:creator>CodeWithBishal-admin</dc:creator>
                        <guid isPermaLink="true">https://discuss.codewithbishal.com/python/consider-the-following-employee-csv-file/#post-33</guid>
                    </item>
				                    <item>
                        <title>Consider the following Employee.csv file :</title>
                        <link>https://discuss.codewithbishal.com/python/consider-the-following-employee-csv-file/#post-32</link>
                        <pubDate>Mon, 21 Nov 2022 19:22:39 +0000</pubDate>
                        <description><![CDATA[Consider the following Employee.csv file :
 

empid,Name,Age,City,Sal
100,Ritesh,25,mumbai,15000
101,Akash,26,Goa,16000
,,,,
102,Mahima,27,Hyderabad,20000
103,Lakshay,28,Delhi,18000...]]></description>
                        <content:encoded><![CDATA[<p>Consider the following Employee.csv file :</p>
<p> </p>
<div>
<pre contenteditable="false">empid,Name,Age,City,Sal
100,Ritesh,25,mumbai,15000
101,Akash,26,Goa,16000
,,,,
102,Mahima,27,Hyderabad,20000
103,Lakshay,28,Delhi,18000
104,Manu,25,Mumbai,25000
105,Nidhi,26,Delhi,
106,Geetu,30,Bangaluru,28000</pre>
</div>
<p> </p>
<p>1. WAP to display the shape of employee.csv file.</p>
<p>2. WAP to display Name, Age and Salary from employee.csv</p>
<p>3. WAP to display only 5 records from employee.csv.</p>
<p>4. WAP to display records without header.</p>
<p>5. WAP to display employee.csv file without index numbers.</p>
<p>6. WAP to display employee.csv file with new column names.</p>
<p>7. WAP to modify the employee name from Mahima to Harsh.</p>
<p>8. WAP to create a new CSV file by copying the contents of employee.csv.</p>
<p>9. WAP to create a duplicate file for employee.csv containing Empid and Employee Name.</p>
<div id="wpfa-239" class="wpforo-attached-file"><a class="wpforo-default-attachment" title="Screenshot-2022-11-22-at-12.50.52-AM.png" href="//discuss.codewithbishal.com/wp-content/uploads/wpforo/default_attachments/1669058559-Screenshot-2022-11-22-at-125052-AM.png" target="_blank" rel="noopener"><i class="fas fa-paperclip"></i> Screenshot-2022-11-22-at-12.50.52-AM.png</a></div>]]></content:encoded>
						                            <category domain="https://discuss.codewithbishal.com/python/">Python</category>                        <dc:creator>CodeWithBishal-admin</dc:creator>
                        <guid isPermaLink="true">https://discuss.codewithbishal.com/python/consider-the-following-employee-csv-file/#post-32</guid>
                    </item>
							        </channel>
        </rss>
		