Commit 8f151ed8 by mohammed.shibili

json initial

parents
# Default ignored files
/shelf/
/workspace.xml
<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 (pandas reading)" 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$/.idea/pandas reading.iml" filepath="$PROJECT_DIR$/.idea/pandas reading.iml" />
</modules>
</component>
</project>
\ 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
<?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
from scrips.core.handlers.read_data import data_set
data_set()
\ No newline at end of file
from scrips.core.handlers.read_data import data_set
data_set()
\ No newline at end of file
import pandas as pd
def data_set():
# reading data frames as chunks
data_frame = pd.read_csv('scrips/utils/MOCK_DATA.csv', chunksize=100)
# concatenating first name and into full name
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('E:\pandas reading\scrips/utils/append.csv', index=False)
# finding a name with certain id
# search_id = 200
# result = chunks.loc[chunks['id'] == search_id]
# if result == [""]:
# break
# else:
# print(result)
# finding elements with iloc()
# result_of_iloc = chunks.iloc[5, 3]
# print(result_of_iloc)
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