[Solved] Event Management System II Eliminate Column using Pandas Python

Event Management System II Eliminate Column: Sunil, an event manager found his data set was cleaned by the development team and was as required. He also found that his data set was cleaned based on the missing values in rows. He thought it would be helpful if the data set was cleaned based on columns.

So, he requests the development team to do the needful. Assume that you are currently working under development team. Frame a dataset (having 10 rows and 10columns of data) for Event Management System. Consider the threshold as all values should be available, (ie. all the values should be available in a column.) If any value is missing, then drop the particular column.

Event Management System II Eliminate Column

Input Format:
Create a CSV file containing the data set of 10 rows and 10 columns.

NOTE:
CSV File contains the comma seperated values as shown below.
[SlNo,EventName,EventManager,NoOfDates,StartDate,EndDate,HallName,HallAddress,HallPricePerDay,TotalCost]

Output Format:
 The output should display the data after dropping the rows with missing values from the data set. 

[Refer Sample Input and Output format for format specifications. All text in bold correspond to Input and rest correspond to output.]

Sample Input:
EventManagementSystem.csv

HINT: The EventManagementSystem.csv file can contain the data in the following format.

EventName                         EventManager NoOfDays       StartDate        EndDate      HallName                          HallAddress                                                                   HallPricePerDay TotalCost

                                                krishnanand             2                    12-08-2005 13-08-2005 Krishna mansion           Krishna Mansion, Krishnalaya, Shringeri                  60000                    120000

Birthday Celebration Akshay                           1                     14-08-2005 14-08-2005 Akshayalaya                   Akshayalaya, Akshaya Dama, Shimoga                 35000                     35000

House Warming              Sunil                             1                     21-10-2005 21-10-2005 Sugamya Corner          Sugamya corner, Vijaya Nagar, Mysore                  50000                     50000

Naming Ceremony         Surya                          1                     10-11-2005 10-11-2005 Suryodaya comforts     Suryodaya comforts, Srirampura                             20000                     20000

Promotion Celebration Aliya                            1                     15-11-2005 15-11-2005 Kabule convention hall                                                                                                 20000                     20000

New Year Celebration Chandan                   2                     31-12-2005 01-12-2005 Chinnaswamy stadium      Bangalore                                                                     12000                      24000

Chrismas Celebration Collin                            2                    24-12-2005 25-12-2005 Saint Philominas church   Mysore                                                                             25000                      50000

Project outing                  Yaradru                      2                    29-11-2005 30-11-2005 Mysore Palace                       Mysore                                                                                                              15000

Sample Output:

+—-+——-+———————-+————+————————-+————————————————–+—————–+———–+

|    | Sl_No |     EventManager     |  EndDate   |         HallName        |                   HallAddress                    | HallPricePerDay | TotalCost |

+—-+——-+———————-+————+————————-+————————————————–+—————–+———–+

| 0  |   1   |     krishnanand      | 13-08-2005 |     krishna mansion     |      Krishna Mansion ,Krishnalaya,Shringeri      |      60000      |   120000  |

| 1  |   2   |        Akshay        | 14-08-2005 |       Akshayalaya       | Akshayalaya, Akshaya Dama,Yogendra Nagar,Shimoga |      35000      |   35000   |

| 2  |   3   |        sunil         | 21-10-2005 |      Sugamya Corner     |       sugamya corner ,Vijaya nagar,Mysore        |      50000      |   50000   |

| 3  |   4   |        Surya         | 10-11-2005 |    Suryodaya comforts   |          Suryodaya comforts,Srirampura           |      20000      |   20000   |

| 4  |   5   |        Aliya         | 15-11-2005 |  Kabule convention hall |                Nr Mohalla,Mysore                 |      20000      |   20000   |

| 5  |   6   | Chandan v            | 01-12-2005 |   Chinnaswammy stadium  |                    Bangalore                     |      12000      |   24000   |

| 6  |   7   |        Collin        | 25-12-2005 | Saint Philominas chruch |                      Mysore                      |      25000      |   50000   |

| 7  |   8   |       Yaradru        | 30-11-2005 |    Lalth Mahal Palace   |                      Mysore                      |      15000      |   30000   |

| 8  |   9   |        Akshay        | 14-08-2005 |       Akshayalaya       | Akshayalaya, Akshaya Dama,Yogendra Nagar,Shimoga |      35000      |   35000   |

| 9  |   10  |     krishnanand      | 13-08-2005 |     krishna mansion     |      Krishna Mansion ,Krishnalaya,Shringeri      |      60000      |   120000  |

| 10 |   11  |     krishnanand      | 16-08-2005 |     krishna mansion     |      Krishna Mansion ,Krishnalaya,Shringeri      |      60000      |   60000   |

+—-+——-+———————-+————+————————-+————————————————–+—————–+———–+

Solution:

Event_Management_system.csv

Sl_No,EventName,EventManager,NoOfDates,StartDate,EndDate,Expected Audience,HallName,HallAddress,HallPricePerDay,TotalCost
1,,krishnanand,2,12-08-2005,13-08-2005,20000,krishna mansion,"Krishna Mansion ,Krishnalaya,Shringeri",60000,120000
2,Birthday Celebration,Akshay,1,14-08-2005,14-08-2005,,Akshayalaya,"Akshayalaya, Akshaya Dama,Yogendra Nagar,Shimoga",35000,35000
3,House Warming,sunil,1,21-10-2005,21-10-2005,1000,Sugamya Corner,"sugamya corner ,Vijaya nagar,Mysore",50000,50000
4,Naming Ceremony,Surya,1,10-11-2005,10-11-2005,1500,Suryodaya comforts,"Suryodaya comforts,Srirampura",20000,20000
5,Promossion Celebration,Aliya,1,15-11-2005,15-11-2005,250,Kabule convention hall,"Nr Mohalla,Mysore",20000,20000
6,New Year Celebration,Chandan v           ,,31-12-2005,01-12-2005,700,Chinnaswammy stadium,Bangalore,12000,24000
7,Chrismas Celebration,Collin,2,24-12-2005,25-12-2005,1500,Saint Philominas chruch,Mysore,25000,50000
8,Project outing,Yaradru,2,,30-11-2005,25,Lalth Mahal Palace,Mysore,15000,30000
9,Birthday Celebration,Akshay,1,14-08-2005,14-08-2005,10000,Akshayalaya,"Akshayalaya, Akshaya Dama,Yogendra Nagar,Shimoga",35000,35000
10,Reception,krishnanand,2,12-08-2005,13-08-2005,25000,krishna mansion,"Krishna Mansion ,Krishnalaya,Shringeri",60000,120000
11,Marraige,krishnanand,1,15-08-2005,16-08-2005,25000,krishna mansion,"Krishna Mansion ,Krishnalaya,Shringeri",60000,60000
import pandas as pd
from tabulate import tabulate as tb


df = pd.read_csv('Event_Management_system.csv')

df = df.dropna(axis=1)

print(tb(df, headers='keys', tablefmt='psql'))

Happy Learning – If you require any further information, feel free to contact me.

Share your love
Saurav Hathi

Saurav Hathi

I'm currently studying Bachelor of Computer Science at Lovely Professional University in Punjab.

📌 Nodejs and Android 😎
📌 Java

Articles: 444

Leave a Reply

Your email address will not be published. Required fields are marked *