Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Compete with Pandas in Python: Stupid Trick 1 Here youll create a couple of small dicts, put them in a list, and then use the

Compete with Pandas in Python:

Stupid Trick 1

Here youll create a couple of small dicts, put them in a list, and then use the list to create a Pandas DataFrame.

Step 1 - create the following three dicts.

DictA has the following key:value pairs:

a:1, b:2, c:3

DictB has these:

a:10, b:20, c:30

And, DictC has these:

a: 100, b:200, c:300

Step 2 Make ListODicts, a Python list that has the three Dicts, above, as elements.

Step 3 Use ListODicts to create a Pandas DataFrame, like pd.DataFrame(ListODicts)

Describe this DataFrame. Whats it like?

Stupid Trick 2

For this one youre going to append a couple of DataFrames

Step 1 create the following Dicts:

DictA = {a:[1,2,3,4],b:[5,6,7,8],c: [10,9,8,7]}

DictB = {a:[100,200,300,4000],c:[50,60,70,80],g:[1000,2000,3000,0000]}

Step 2 Make "FrameA," a DataFrame, using DictA, and "FrameB," a DataFrame, using DictB

Step 3 Append FrameB to FrameA so that the rows in FrameB follow the rows in FrameA. When you do this, make the index in the resulting DataFrame have unique index values for the rows.

Describe this new DataFrame. What does it look like? Is there anything about it that surprises you?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Marketing The Ultimate Marketing Tool

Authors: Edward L. Nash

1st Edition

0070460639, 978-0070460638

More Books

Students also viewed these Databases questions

Question

4. Who would lead the group?

Answered: 1 week ago

Question

Explain the function and purpose of the Job Level Table.

Answered: 1 week ago