<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Janhavi Prakash Jayanagarkar on Medium]]></title>
        <description><![CDATA[Stories by Janhavi Prakash Jayanagarkar on Medium]]></description>
        <link>https://medium.com/@janhavi12oct?source=rss-3198bdefc669------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*ixgaEFOkw36nwlIa</url>
            <title>Stories by Janhavi Prakash Jayanagarkar on Medium</title>
            <link>https://medium.com/@janhavi12oct?source=rss-3198bdefc669------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 04:51:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@janhavi12oct/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Analysis of Periodic Labor Force Survey (PLFS) 2022–23]]></title>
            <link>https://medium.com/@janhavi12oct/analysis-of-periodic-labor-force-survey-plfs-2022-23-db4e46f2c28d?source=rss-3198bdefc669------2</link>
            <guid isPermaLink="false">https://medium.com/p/db4e46f2c28d</guid>
            <dc:creator><![CDATA[Janhavi Prakash Jayanagarkar]]></dc:creator>
            <pubDate>Mon, 03 Jun 2024 07:05:01 GMT</pubDate>
            <atom:updated>2024-06-03T07:05:01.043Z</atom:updated>
            <content:encoded><![CDATA[<p>I have been working with the PLFS data from data available from MOSPI,Pune. The dataset includes four text files: HHV1, HHRV, PERV1, and PERRV, along with a CSV file detailing the variables and their byte positions.To manage this large dataset, I parsed each text file according to the byte positions specified in the CSV file, converting them into corresponding CSV files for easier analysis. Due to the dataset’s size, I used Kaggle for processing to avoid performance issues in Jupyter Notebook.I successfully processed the PERV1 file, extracting and structuring the data into CSV format, enabling efficient analysis and handling of the PLFS data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ovz4tIzNueV6QRuPOO32pg.png" /></figure><pre>import numpy as np<br>import pandas as pd<br>df_hh = pd.read_fwf(r&#39;/kaggle/input/perv1-plfs/PERV1.TXT&#39;, header=None)<br>df_hh<br>import numpy as np<br>import pandas as pd<br># Given column specifications<br>column_specifications = &quot;&quot;&quot;<br>1 4<br>5 7<br>8 9<br>10 11<br>12 12<br>13 14<br>15 16<br>17 19<br>20 21<br>22 23<br>24 24<br>25 28<br>29 33<br>34 34<br>35 35<br>36 37<br>38 39<br>40 40<br>41 41<br>42 44<br>45 45<br>46 47<br>48 49<br>50 51<br>52 53<br>54 54<br>55 55<br>56 57<br>58 58<br>59 59<br>60 60<br>61 62<br>63 67<br>68 70<br>71 71<br>72 73<br>74 75<br>76 76<br>77 77<br>78 78<br>79 79<br>80 80<br>81 82<br>83 87<br>88 90<br>91 92<br>93 94<br>95 95<br>96 96<br>97 97<br>98 98<br>99 99<br>100 100<br>101 101<br>102 102<br>103 103<br>104 104<br>105 105<br>106 107<br>108 108<br>109 110<br>111 112<br>113 114<br>115 119<br>120 121<br>122 123<br>124 125<br>126 130<br>131 132<br>133 134<br>135 136<br>137 138<br>139 140<br>141 145<br>146 147<br>148 149<br>150 151<br>152 156<br>157 158<br>159 160<br>161 162<br>163 164<br>165 166<br>167 171<br>172 173<br>174 175<br>176 177<br>178 182<br>183 184<br>185 186<br>187 188<br>189 190<br>191 192<br>193 197<br>198 199<br>200 201<br>202 203<br>204 208<br>209 210<br>211 212<br>213 214<br>215 216<br>217 218<br>219 223<br>224 225<br>226 227<br>228 229<br>230 234<br>235 236<br>237 238<br>239 240<br>241 242<br>243 244<br>245 249<br>250 251<br>252 253<br>254 255<br>256 260<br>261 262<br>263 264<br>265 266<br>267 268<br>269 270<br>271 275<br>276 277<br>278 279<br>280 281<br>282 286<br>287 288<br>289 290<br>291 292<br>293 294<br>295 297<br>298 305<br>306 313<br>314 316<br>317 319<br>320 329<br>330 330<br>&quot;&quot;&quot;<br><br># Splitting the column specifications into individual pairs of numbers<br>pairs = [tuple(map(int, line.split())) for line in column_specifications.strip().split(&#39;\n&#39;)]<br><br># Column names<br>col_names = [&#39;File Identification&#39;, &#39;Schdule&#39;, &#39;Quarter&#39;, &#39;Visit&#39;, &#39;Sector&#39;, &#39;State/Ut Code&#39;, &#39;District Code&#39;, &#39;NSS-Region&#39;,&#39;Stratum&#39;, &#39;Sub-Stratum&#39;, &#39;Sub-Sample&#39;, &#39;Fod Sub-Region&#39;, &#39;FSU&#39;, &#39;Sample Sg/Sb No.&#39;, &#39;Second Stage Stratum No.&#39;, &#39;Sample Household Number&#39;, &#39;Person Serial No.&#39;, &#39;Relationship To Head&#39;, &#39;Sex&#39;, &#39;Age&#39;, &#39;Marital Status&#39;, <br>             &#39;General Educaion Level&#39;, &#39;Technical Educaion Level&#39;, &#39;No. of years in Formal Education&#39;, <br>             &#39;Status of Current Attendance in Educational Institution&#39;, &#39;Whether received any Vocational/Technical Training&#39;, <br>             &#39;Whether Training completed during last 365 Days&#39;, &#39;Field Of Training&#39;, &#39;Duration Of Training&#39;, &#39;Type Of Training&#39;, <br>             &#39;Source Of Funding The Training&#39;, &#39;Status Code&#39;, &#39;Industry Code (NIC)&#39;, &#39;Occupation Code (NCO)&#39;, <br>             &#39;Whether Engaged In Any Work In Subsidiary Capacity&#39;, &#39;(Principal)location Of Workplace Code&#39;, <br>             &#39;(Principal) Enterprise Type Code&#39;, &#39;(Principal) No. Of Workers In The Enterprise&#39;, <br>             &#39;(Principal) Type Of Job Contract&#39;, &#39;(Principal) Eligble Of Paid Leave&#39;, &#39;(Principal) Social Security Benefits&#39;, <br>             &#39;(Principal) Usage of product of the economic activity&#39;, &#39;Status Code&#39;, &#39;Industry Code (NIC)&#39;, <br>             &#39;Occupation Code (NCO)&#39;, &#39;(Subsidiary) location Of Workplace Code&#39;, &#39;(Subsidiary) Enterprise Type Code&#39;, <br>             &#39;(Subsidiary) No. Of Workers In The Enterprise&#39;, &#39;(Subsidiary) Type Of Job Contract&#39;, <br>             &#39;(Subsidiary) Eligble Of Paid Leave&#39;, &#39;(Subsidiary) Social Security Benefits&#39;, <br>             &#39;(Subsidiary) Usage of product of the economic activity&#39;, &#39;Ever Worked Prior to last 365 days&#39;, <br>             &#39;Duration of engagement in the economic activity in usual Principal Activity Status&#39;, <br>             &#39;Duration of engagement in the economic activity in Subsidiary Activity Status&#39;, &#39;Efforts undertaken to search work&#39;, <br>             &#39;Duration of spell of Unemployment&#39;, &#39;Whether Ever Worked&#39;, &#39;Reason for not working in last 365 days&#39;, <br>             &#39;Main reason for being in Principal activity status (91 to 97)&#39;, &#39;Status Code for activity 1&#39;, <br>             &#39;Industry Code (NIC) for activity 1&#39;, &#39;hours actuallly worked for activity 1 on 7 th day&#39;, <br>             &#39;wage earning for activity 1 on 7 th day&#39;, &#39;Status Code for activity 2&#39;, &#39;Industry Code (NIC) for activity 2&#39;, <br>             &#39;hours actuallly worked for activity 2 on 7 th day&#39;, &#39;wage earning for activity 2 on 7 th day&#39;, <br>             &#39;total hours actually worked on 7th day&#39;, &#39;hours available for aditional worked on 7th day&#39;, <br>             &#39;Status Code for activity 1&#39;, &#39;Industry Code (NIC) for activity 1&#39;, &#39;hours actuallly worked for activity 1 on 6 th day&#39;, <br>             &#39;wage earning for activity 1 on 7 th day&#39;, &#39;Status Code for activity 2&#39;, &#39;Industry Code (NIC) for activity 2&#39;, <br>             &#39;hours actuallly worked for activity 2 on 6 th day&#39;, &#39;wage earning for activity 2 on 6 th day&#39;, <br>             &#39;total hours actually worked on 6th day&#39;, &#39;hours available for aditional worked on 6th day&#39;, <br>             &#39;Status Code for activity 1&#39;, &#39;Industry Code (NIC) for activity 1&#39;, &#39;hours actuallly worked for activity 1 on5 th day&#39;, <br>             &#39;wage earning for activity 1 on 5 th day&#39;, &#39;Status Code for activity 2&#39;, &#39;Industry Code (NIC) for activity 2&#39;, <br>             &#39;hours actuallly worked for activity 2 on 5 th day&#39;, &#39;wage earning for activity 2 on 5 th day&#39;, <br>             &#39;total hours actually worked on 5th day&#39;, &#39;hours available for aditional worked on 5th day&#39;, <br>             &#39;Status Code for activity 1&#39;, &#39;Industry Code (NIC) for activity 1&#39;, &#39;hours actuallly worked for activity 1 on 4th day&#39;, <br>             &#39;wage earning for activity 1 on 4th day&#39;, &#39;Status Code for activity 2&#39;, &#39;Industry Code (NIC) for activity 2&#39;, <br>             &#39;hours actuallly worked for activity 2 on 4th day&#39;, &#39;wage earning for activity 2 on 4th day&#39;, <br>             &#39;total hours actually worked on 4th day&#39;, &#39;hours available for aditional worked on 4th day&#39;, <br>             &#39;Status Code for activity 1&#39;, &#39;Industry Code (NIC) for activity 1&#39;, &#39;hours actuallly worked for activity 1 on 3rd day&#39;, <br>             &#39;wage earning for activity 1 on 3rd day&#39;, &#39;Status Code for activity 2&#39;, &#39;Industry Code (NIC) for activity 2&#39;, <br>             &#39;hours actuallly worked for activity 2 on 3rd day&#39;, &#39;wage earning for activity 2 on 3 rd day&#39;, <br>             &#39;total hours actually worked on 3rd day&#39;, &#39;hours available for aditional worked on 3rd day&#39;, <br>             &#39;Status Code for activity 1&#39;, &#39;Industry Code (NIC) for activity 1&#39;, &#39;hours actuallly worked for activity 1 on 2nd day&#39;, <br>             &#39;wage earning for activity 1 on 2nd day&#39;, &#39;Status Code for activity 2&#39;, &#39;Industry Code (NIC) for activity 2&#39;, <br>             &#39;hours actuallly worked for activity 2 on 2nd day&#39;, &#39;wage earning for activity 2 on 2nd day&#39;, <br>             &#39;total hours actually worked on 2nd day&#39;, &#39;hours available for aditional worked on 2nd day&#39;, <br>             &#39;Status Code for activity 1&#39;, &#39;Industry Code (NIC) for activity 1&#39;, &#39;hours actuallly worked for activity 1 on 1st day&#39;, <br>             &#39;wage earning for activity 1 on 1st day&#39;, &#39;Status Code for activity 2&#39;, &#39;Industry Code (NIC) for activity 2&#39;, <br>             &#39;hours actuallly worked for activity 2 on 1st day&#39;, &#39;wage earning for activity 2 on 1st day&#39;, <br>             &#39;total hours actually worked on 1st day&#39;, &#39;hours available for aditional worked on 1st day&#39;, <br>             &#39;Current Weekly Status (CWS)&#39;, &#39;Industry Code (CWS)&#39;, &#39;Occupation Code (CWS)&#39;, <br>             &#39;Earnings For Regular Salaried/Wage Activity&#39;, &#39;Earnings For Self Employed&#39;, <br>             &#39;Ns count for sector x stratum x substratum x sub-sample&#39;, &#39;Ns count for sector x stratum x substratum&#39;, <br>             &#39;Sub-sample wise Multiplier&#39;, &#39;Occurence of FSUs in State x Sector x Stratum x SubStratum in 4 Quarters&#39;<br>]<br><br># Ensure all column names are unique by appending a suffix to duplicates<br>col_names_unique = []<br>seen = set()<br>for name in col_names:<br>    if name not in seen:<br>        col_names_unique.append(name)<br>        seen.add(name)<br>    else:<br>        suffix = 1<br>        while f&quot;{name}_{suffix}&quot; in seen:<br>            suffix += 1<br>        col_names_unique.append(f&quot;{name}_{suffix}&quot;)<br>        seen.add(f&quot;{name}_{suffix}&quot;)<br><br># Ensure number of column specifications matches number of column names<br>if len(pairs) != len(col_names_unique):<br>    raise ValueError(&quot;Number of column specifications does not match number of column names&quot;)<br><br># Adjust column specifications to match Python indexing (start from 0 instead of 1)<br>formatted_pairs = [(start - 1, end) for start, end in pairs]<br><br># Read the fixed-width file<br>df_hh = pd.read_fwf(r&#39;/kaggle/input/perv1-plfs/PERV1.TXT&#39;, header=None, colspecs=formatted_pairs, names=col_names_unique)<br><br>df_hh</pre><pre>import pandas as pd<br><br># Read the Excel file<br>state_code = pd.read_excel(r&#39;/kaggle/input/data-layoutplfs-2022-23/Data_LayoutPLFS_2022-23.xlsx&#39;, sheet_name=&#39;State code&#39;)<br><br># Drop the first row as it may contain column names<br>state_code.drop(index=state_code.index[0], axis=0, inplace=True)<br><br># Print the column names to identify the correct column name<br>print(state_code.columns)<br><br># Assuming the correct column names are &#39;State Name &amp; Code used in PLFS&#39; and &#39;Unnamed: 1&#39;<br>StateUt_Code = pd.Series(state_code[&#39;Unnamed: 1&#39;].values, index=state_code[&#39;State Name &amp; Code used in PLFS&#39;]).to_dict()<br>StateUt_Code</pre><p>convert this Text file into csv</p><pre>df_hh.to_csv(r&#39;/kaggle/working/final_df_hh.csv&#39;, index = False)<br>final_df_hh= pd.read_csv(&#39;/kaggle/working/final_df_hh.csv&#39;)<br>final_df_hh</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yzbkWLzF8clvak_MNoS1aA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=db4e46f2c28d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>