Giter Site home page Giter Site logo

data-organiztion's Introduction

"# Data-organization"

Data-organization

In this File I used Python and Google collab to seperate CSV formatted Data Open This file In google collab and you should be able to Run the code in blocks so you can see every step of the way

Make sure that you uploaded your data into google collabe if you are going to use Google collab, if you are using Other coding software Make sure that your data is in the correct Directory, and That is it in CSV format As this code Is designed for CSV

Getting Into Data Orginzation

First Step is to import the necessary Modules

import pandas as pd
import numpy as np

Next step is to make sure that your data is the right directory, for use.

Screenshot 2023-04-14 112250

After That Use the Pandas Libraries to read in the CSV file as a DataFrame object:

df = pd.read_csv('/content/1m-PDDS(2023-04-12).csv')

Then Sort the Data Frames Based on the Variables


df = df.sort_values(by=['Location', 'Site', 'Plot','Subplot'])

You Can use the print function to view your how your data is organized thus far

print(df_sorted)
print(df_sorted.head())

Should look somthing Like this (Based on the variables you used)

Screenshot 2023-04-14 112942

Great! Now We will begin grouping the data

grouped_df.size()

Screenshot 2023-04-14 113148

It will look like this showing you how it is grouped and how many times it repeats

Next is Grouping and Download in groups of "Location, Site, Plot" Variables

grouped = df_sorted.groupby(['Location', 'Site', 'Plot'])

for name, group in grouped:
    filename = f"{name[0]}_{name[1]}_{name[2]}.csv"
    group.to_csv(filename, index=False)

And Thats It!

Review Your Data to Make sure all went Well #Happy Coding!

data-organiztion's People

Contributors

codem47 avatar techsower avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.