Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
json_operation_python
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rakesh.pv
json_operation_python
Commits
dd9cd21e
Commit
dd9cd21e
authored
Jan 30, 2023
by
rakesh.pv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes
parent
2080c1c8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletions
+18
-1
scripts/core/handlers/json_file.py
+1
-1
scripts/core/handlers/make_new_df.py
+17
-0
No files found.
scripts/core/handlers/json_file.py
View file @
dd9cd21e
...
@@ -2,7 +2,7 @@ import pandas as pd
...
@@ -2,7 +2,7 @@ import pandas as pd
import
json
import
json
from
scripts.config.application_config
import
json_path
from
scripts.config.application_config
import
json_path
from
scripts.core.handlers.
create_new_dataframe
import
create_dataframe
from
scripts.core.handlers.
make_new_df
import
create_dataframe
def
create_json_file
(
path
):
def
create_json_file
(
path
):
...
...
scripts/core/handlers/make_new_df.py
0 → 100644
View file @
dd9cd21e
import
pandas
as
pd
def
create_dataframe
(
dataframe
):
try
:
# Takes first 10 rows in the Excel file
first_ten_data
=
dataframe
.
head
(
10
)
# Takes last 10 rows in the Excel file
last_ten_data
=
dataframe
.
tail
(
10
)
# Creating new dataframe
new_dataframe
=
pd
.
DataFrame
()
new_dataframe
=
pd
.
concat
([
new_dataframe
,
first_ten_data
],
ignore_index
=
True
)
new_dataframe
=
pd
.
concat
([
new_dataframe
,
last_ten_data
],
ignore_index
=
True
)
return
new_dataframe
except
Exception
as
e
:
print
((
"Error: "
,
e
))
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment