Commit 09b02f98 by rakesh.pv

csv : python read : pandas operation : codebase struct

parents
# Default ignored files
/shelf/
/workspace.xml
csv_read_concat_python_codebase
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/venv" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.9" project-jdk-type="Python SDK" />
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/../csv_and_pandas-master-8f151ed8c92ee86e30f8253f5db0f7ec06356c4c/.idea/csv_read_concat_python_codebase.iml" filepath="$PROJECT_DIR$/../csv_and_pandas-master-8f151ed8c92ee86e30f8253f5db0f7ec06356c4c/.idea/csv_read_concat_python_codebase.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
import os
import uvicorn
from scrips.core.services.app import data_set
if __name__ == "__main__":
data_set()
import pandas as pd
def data_set():
data_frame = pd.read_csv('scrips/temp/MOCK_DATA.csv', chunksize=100)
head_of_new_data = []
i = 1
new_dataframe = pd.DataFrame(columns=head_of_new_data)
for chunks in data_frame:
chunks['full_name'] = chunks['first_name'] + chunks['last_name']
while i > 0:
head_of_new_data.append(chunks.head(0))
i = i - 1
new_dataframe = pd.concat([new_dataframe, chunks])
new_dataframe.to_csv('scrips/temp/new_df.csv', index=False)
from scrips.core.handlers.read_data import data_set
data_set()
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment