Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
guipsamora
GitHub Repository: guipsamora/pandas_exercises
Path: blob/master/05_Merge/Housing Market/Exercises.ipynb
548 views
Kernel: Python 2

Housing Market

Introduction:

This time we will create our own dataset with fictional numbers to describe a house market. As we are going to create random data don't try to reason of the numbers.

Step 1. Import the necessary libraries

Step 2. Create 3 differents Series, each of length 100, as follows:

  1. The first a random number from 1 to 4

  2. The second a random number from 1 to 3

  3. The third a random number from 10,000 to 30,000

Step 3. Let's create a DataFrame by joinning the Series by column

Step 4. Change the name of the columns to bedrs, bathrs, price_sqr_meter

Step 5. Create a one column DataFrame with the values of the 3 Series and assign it to 'bigcolumn'

Step 6. Oops, it seems it is going only until index 99. Is it true?

Step 7. Reindex the DataFrame so it goes from 0 to 299