DataFrames
The DataFrame is like a super data structure, holding other data structures inside of it.
Construction
Think of some data that you can put into sequences of containers (a.k.a. rows of columns)
3 x 4 dataset:
DataFrames are made from rows and columns. The rows and columns have a list-like structure, and can be
constructed with lists. Create an empty DataFrame, and give it a column and a list. Then, create a another, and
add it to the first.
Code DataFrame: sql, my project,
One of the coolest things about DataFrames are that they evolved to work with real data. In fact, you can
give Pandas a data file, and it will construct for you a DataFrame. Let's make a data file, and then load it up.
Load a CSV:
Editing the DataFrame
Your DataFrame can be grouped, or reshuffled.
If you need to get only subsets of data, you can slice them.
Plotting Data
Once your data is loaded into the frame, you can see it, by plotting it.
write line, scatter, and box plots:
Merging DataFrames
Merging DataFrames is accomplished through stacking , joining, and merging
We can stack DataFrames as rows by appending. Append two Series (1-D DataFrames):
We can stack both DataFrames vertically and horizontally by specifying the axis by concatenating.
Stack a multi-indexed DataFrames with concatenation, by adding keys, as well as axis, like so:
Inner and outer joins are another way to merge DataFrames. You give a key and axis, and specify the join.
You can also join multiple merged DataFrames.