Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write Python programs (use matplotlib.pyplot, if required) to calculate and display various information about comic books from the CSV files given (THE CODE SHOULD WORK

Write Python programs (use matplotlib.pyplot, if required) to calculate and display various information about comic books from the CSV files given (THE CODE SHOULD WORK ON BOTH CSV FILES):

1) Print the number of characters that are a gender or sexual minority (GSM). Give both the total number and percentage of all characters. For this, assume that any entry in the column is a GSM character.

2) Print the oldest character (by year). If there are multiple characters tied for oldest, print them all. You only need to use the year for this calculation.

3) Print the character with the most appearances.

dc_data.csv:

page_id,name,urlslug,id,align,eye,hair,sex,gsm,alive,appearances,first_appearance,year 1380,Flash (Barry Allen),\/wiki\/Flash_(Barry_Allen),Secret Identity,Good Characters,Blue Eyes,Blond Hair,Male Characters,,Living Characters,1028,"1956, October",1956 1383,Flash (Wally West),\/wiki\/Flash_(Wally_West),Secret Identity,Good Characters,Green Eyes,Red Hair,Male Characters,,Living Characters,,"1960, January",1960 1386,Jason Garrick (New Earth),\/wiki\/Jason_Garrick_(New_Earth),Public Identity,Good Characters,Blue Eyes,Brown Hair,Male Characters,,Living Characters,951,"1940, January",1940 1399,Eobard Thawne (New Earth),\/wiki\/Eobard_Thawne_(New_Earth),Secret Identity,Bad Characters,Blue Eyes,Strawberry Blond Hair,Male Characters,,Deceased Characters,89,"1963, September",1963 1422,Batman (Bruce Wayne),\/wiki\/Batman_(Bruce_Wayne),Secret Identity,Good Characters,Blue Eyes,Black Hair,Male Characters,,Living Characters,3093,"1939, May",1939 1430,Bartholomew Allen II (New Earth),\/wiki\/Bartholomew_Allen_II_(New_Earth),Secret Identity,Good Characters,Yellow Eyes,,Male Characters,,Living Characters,,"1994, July",1994 1434,Max Mercury (New Earth),\/wiki\/Max_Mercury_(New_Earth),Secret Identity,Good Characters,Blue Eyes,Grey Hair,Male Characters,,Living Characters,183,"1940, November",1940 1445,Jason Todd (New Earth),\/wiki\/Jason_Todd_(New_Earth),Secret Identity,Neutral Characters,Blue Eyes,Black Hair,Male Characters,,Living Characters,235,"1987, June",1987 1448,Wonder Woman (Diana Prince),\/wiki\/Wonder_Woman_(Diana_Prince),Public Identity,Good Characters,Blue Eyes,Black Hair,Female Characters,,Living Characters,1231,"1941, December",1941 1449,Donna Troy (New Earth),\/wiki\/Donna_Troy_(New_Earth),Public Identity,Good Characters,Blue Eyes,Black Hair,Female Characters,,Living Characters,,"1965, July",1965 1450,Lana Lang (New Earth),\/wiki\/Lana_Lang_(New_Earth),Public Identity,Good Characters,Green Eyes,Red Hair,Female Characters,,Living Characters,159,"1986, October",1986 1451,Timothy Drake (New Earth),\/wiki\/Timothy_Drake_(New_Earth),Secret Identity,Good Characters,Blue Eyes,Black Hair,Male Characters,,Living Characters,1095,"1989, August",1989 1453,Stephanie Brown (New Earth),\/wiki\/Stephanie_Brown_(New_Earth),Secret Identity,Good Characters,Blue Eyes,Blond Hair,Female Characters,,Living Characters,198,"1992, August",1992 1454,Arthur Brown (New Earth),\/wiki\/Arthur_Brown_(New_Earth),,Bad Characters,Blue Eyes,Blond Hair,Male Characters,,Living Characters,59,"1966, May",1966 1455,Joker (New Earth),\/wiki\/Joker_(New_Earth),Secret Identity,Bad Characters,Green Eyes,Green Hair,Male Characters,,Living Characters,517,"1940, June",1940 1456,Alfred Pennyworth (New Earth),\/wiki\/Alfred_Pennyworth_(New_Earth),Public Identity,Good Characters,Blue Eyes,Black Hair,Male Characters,,Living Characters,930,"1943, April",1943 1458,Green Lantern (Hal Jordan),\/wiki\/Green_Lantern_(Hal_Jordan),Secret Identity,Good Characters,Brown Eyes,Brown Hair,Male Characters,,Living Characters,1565,"1959, October",1959 1459,Alan Scott (New Earth),\/wiki\/Alan_Scott_(New_Earth),Secret Identity,Good Characters,Blue Eyes,Blond Hair,Male Characters,,Deceased Characters,969,"1940, July",1940 1460,Catwoman (Selina Kyle),\/wiki\/Catwoman_(Selina_Kyle),Secret Identity,Neutral Characters,Green Eyes,Black Hair,Female Characters,,Living Characters,,"1940, June",1940 1461,Edward Nashton (New Earth),\/wiki\/Edward_Nashton_(New_Earth),Public Identity,Neutral Characters,Blue Eyes,Black Hair,Male Characters,,Living Characters,173,"1988, January",1988 1462,Oswald Cobblepot (New Earth),\/wiki\/Oswald_Cobblepot_(New_Earth),Public Identity,,Blue Eyes,Black Hair,Male Characters,,Living Characters,253,"1941, December",1941 1463,Bane (New Earth),\/wiki\/Bane_(New_Earth),Secret Identity,Bad Characters,Brown Eyes,Brown Hair,Male Characters,,Living Characters,157,"1993, January",1993 1464,Pamela Isley (New Earth),\/wiki\/Pamela_Isley_(New_Earth),Secret Identity,Neutral Characters,Green Eyes,Red Hair,Female Characters,,Living Characters,286,"1966, June",1966 1465,Silver St. Cloud (New Earth),\/wiki\/Silver_St._Cloud_(New_Earth),Public Identity,,Blue Eyes,Silver Hair,Female Characters,,Deceased Characters,26,"1977, June",1977 1466,Ra's al Ghul (New Earth),\/wiki\/Ra%27s_al_Ghul_(New_Earth),Secret Identity,Bad Characters,Green Eyes,Grey Hair,Male Characters,,Deceased Characters,,"1971, June",1971 1467,Lucius Fox (New Earth),\/wiki\/Lucius_Fox_(New_Earth),Public Identity,Good Characters,Brown Eyes,Black Hair,Male Characters,,Living Characters,133,"1979, January",1979 1468,Jean-Paul Valley (New Earth),\/wiki\/Jean-Paul_Valley_(New_Earth),Secret Identity,Good Characters,Blue Eyes,Blond Hair,Male Characters,,Deceased Characters,234,"1992, October",1992 1469,Harleen Quinzel (New Earth),\/wiki\/Harleen_Quinzel_(New_Earth),Public Identity,Bad Characters,Blue Eyes,Blond Hair,Female Characters,,Living Characters,153,"1999, October",1999 1470,Jervis Tetch (New Earth),\/wiki\/Jervis_Tetch_(New_Earth),Secret Identity,Bad Characters,Blue Eyes,Red Hair,Male Characters,,Living Characters,105,"1948, October",1948 1471,Harvey Dent (New Earth),\/wiki\/Harvey_Dent_(New_Earth),Public Identity,Bad Characters,Blue Eyes,Brown Hair,Male Characters,,Living Characters,306,"1942, August",1942 1473,Basil Karlo (New Earth),\/wiki\/Basil_Karlo_(New_Earth),Secret Identity,Bad Characters,Black Eyes,Black Hair,Male Characters,,Living Characters,,"1940, June",1940 1474,Matthew Hagen (New Earth),\/wiki\/Matthew_Hagen_(New_Earth),Secret Identity,Bad Characters,Blue Eyes,Blond Hair,Male Characters,,Deceased Characters,28,"1961, December",1961 1475,Preston Payne (New Earth),\/wiki\/Preston_Payne_(New_Earth),Secret Identity,Bad Characters,Red Eyes,,Male Characters,,Deceased Characters,25,"1978, June",1978 1477,Cassius Payne (New Earth),\/wiki\/Cassius_Payne_(New_Earth),Secret Identity,Bad Characters,,,Male Characters,,Living Characters,28,"1994, May",1994 1478,John Stewart (New Earth),\/wiki\/John_Stewart_(New_Earth),Public Identity,Good Characters,Brown Eyes,Black Hair,Male Characters,,Living Characters,549,"1971, December",1971 1479,Guy Gardner (New Earth),\/wiki\/Guy_Gardner_(New_Earth),Public Identity,Good Characters,Blue Eyes,Red Hair,Male Characters,,Living Characters,593,"1968, March",1968 1480,Alexander Luthor (New Earth),\/wiki\/Alexander_Luthor_(New_Earth),Public Identity,Bad Characters,Green Eyes,,Male Characters,,Living Characters,677,"1986, October",1986 1481,Theodore Kord (New Earth),\/wiki\/Theodore_Kord_(New_Earth),Secret Identity,,Blue Eyes,Brown Hair,Male Characters,,Deceased Characters,429,"1986, February",1986

marvel_data.csv:

page_id,name,urlslug,id,align,eye,hair,sex,gsm,alive,appearances,first_appearance,year 1025,Emil Blonsky (Earth-616),\/Emil_Blonsky_(Earth-616),Secret Identity,Bad Characters,Blue Eyes,Blond Hair,Male Characters,,Living Characters,115,Apr-67,1967 1026,Absalom (Earth-616),\/Absalom_(Earth-616),Secret Identity,,Blue Eyes,Blond Hair,Male Characters,,Deceased Characters,6,May-92,1992 1027,Carl Creel (Earth-616),\/Carl_Creel_(Earth-616),Public Identity,Bad Characters,Blue Eyes,Bald,Male Characters,,Living Characters,202,Apr-64,1964 1029,Adam Warlock (Earth-616),\/Adam_Warlock_(Earth-616),No Dual Identity,Good Characters,White Eyes,Gold Hair,Male Characters,,Living Characters,252,Sep-67,1967 1030,Adam Neramani (Earth-616),\/Adam_Neramani_(Earth-616),Secret Identity,Good Characters,Blue Eyes,Blond Hair,Male Characters,,Living Characters,21,Oct-93,1993 1032,Eric Cameron (Earth-616),\/Eric_Cameron_(Earth-616),Secret Identity,Bad Characters,Blue Eyes,Brown Hair,Male Characters,,Living Characters,5,Mar-80,1980 1033,Adri Nital (Earth-616),\/Adri_Nital_(Earth-616),No Dual Identity,Bad Characters,Red Eyes,Black Hair,Male Characters,,Deceased Characters,7,Jan-75,1975 1034,Adversary (Earth-616),\/Adversary_(Earth-616),Secret Identity,Bad Characters,Blue Eyes,,Male Characters,,Living Characters,32,Dec-84,1984 1035,Aeroika (Earth-616),\/Aeroika_(Earth-616),,,,Gold Hair,Male Characters,,Living Characters,6,Jan-80,1980 1036,Agatha Harkness (Earth-616),\/Agatha_Harkness_(Earth-616),No Dual Identity,Good Characters,Blue Eyes,White Hair,Female Characters,,Deceased Characters,122,Jan-70,1970 1037,Agent Axis (Earth-616),\/Agent_Axis_(Earth-616),Secret Identity,Bad Characters,,White Hair,Male Characters,,Deceased Characters,13,Aug-77,1977 1038,Cynthia Glass (Earth-616),\/Cynthia_Glass_(Earth-616),Secret Identity,Neutral Characters,Blue Eyes,Brown Hair,Female Characters,,Deceased Characters,6,Sep-91,1991 1039,Christoph Nord (Earth-616),\/Christoph_Nord_(Earth-616),Secret Identity,Good Characters,Blue Eyes,Black Hair,Male Characters,,Living Characters,66,Feb-92,1992 1040,Aginar (Earth-616),\/Aginar_(Earth-616),Secret Identity,,Grey Eyes,Black Hair,Male Characters,,Living Characters,6,May-77,1977 1041,Agon (Earth-616),\/Agon_(Earth-616),No Dual Identity,,,Black Hair,Male Characters,,Deceased Characters,4,Jan-68,1968 1043,Alejandro Montoya (Earth-616),\/Alejandro_Montoya_(Earth-616),Secret Identity,Good Characters,Brown Eyes,Black Hair,Male Characters,,Living Characters,18,Aug-79,1979 1047,Gabriel Lan (Earth-616),\/Gabriel_Lan_(Earth-616),Secret Identity,,Black Eyes,Black Hair,Male Characters,,Deceased Characters,14,Apr-81,1981 1048,Air-Walker (Automaton) (Earth-616),\/Air-Walker_(Automaton)_(Earth-616),,,Black Eyes,No Hair,Male Characters,,Living Characters,27,Mar-72,1972 1050,Ajak (Earth-616),\/Ajak_(Earth-616),Secret Identity,,Grey Eyes,Black Hair,Male Characters,,Living Characters,40,Aug-76,1976 1052,Thomas Jones (Earth-616),\/Thomas_Jones_(Earth-616),Secret Identity,Good Characters,Brown Eyes,Brown Hair,Male Characters,,Living Characters,11,Jun-89,1989 1054,Allatou (Earth-616),\/Allatou_(Earth-616),,Bad Characters,Red Eyes,Green Hair,Female Characters,,Living Characters,7,Oct-74,1974 1056,Alpha (Mutant) (Earth-616),\/Alpha_(Mutant)_(Earth-616),Secret Identity,Neutral Characters,Yellow Eyes,Bald,Male Characters,,Living Characters,11,Sep-74,1974 1057,Marlene Alraune (Earth-616),\/Marlene_Alraune_(Earth-616),No Dual Identity,Good Characters,Blue Eyes,Blond Hair,Female Characters,,Living Characters,156,Jun-76,1976 1058,Amaa (Earth-616),\/Amaa_(Earth-616),,,,,Female Characters,,Living Characters,,Jan-83,1983 1060,Ambur Amaquelin (Earth-616),\/Ambur_Amaquelin_(Earth-616),No Dual Identity,,Blue Eyes,Red Hair,Female Characters,,Living Characters,1,11-Jan,2011 1061,Jason Strongbow (Earth-616),\/Jason_Strongbow_(Earth-616),Secret Identity,Good Characters,Brown Eyes,Black Hair,Male Characters,,Living Characters,23,Sep-81,1981 1062,Lyle Dekker (Earth-616),\/Lyle_Dekker_(Earth-616),Public Identity,Bad Characters,Blue Eyes,Blond Hair,Male Characters,,Deceased Characters,11,Feb-78,1978 1063,Ammo (Earth-616),\/Ammo_(Earth-616),,Bad Characters,Brown Eyes,Black Hair,Male Characters,,Living Characters,4,Mar-88,1988 1065,Amphibius (Earth-616),\/Amphibius_(Earth-616),Secret Identity,Bad Characters,Yellow Eyes,No Hair,Male Characters,,Living Characters,38,Nov-69,1969 1066,Blanche Sitznski (Earth-616),\/Blanche_Sitznski_(Earth-616),Secret Identity,Bad Characters,Green Eyes,Blond Hair,Female Characters,,Living Characters,69,Jun-80,1980 1067,Tike Alicar (Earth-616),\/Tike_Alicar_(Earth-616),Secret Identity,Good Characters,Brown Eyes,Black Hair,Male Characters,,Deceased Characters,50,1-Jul,2001 1068,Yao (Earth-616),\/Yao_(Earth-616),Secret Identity,Good Characters,Brown Eyes,Bald,Male Characters,,Living Characters,122,Jun-61,1961 1069,Andromeda Attumasen (Earth-616),\/Andromeda_Attumasen_(Earth-616),No Dual Identity,Good Characters,Green Eyes,Auburn Hair,Female Characters,,Living Characters,42,May-85,1985 1070,David Angar (Earth-616),\/David_Angar_(Earth-616),Secret Identity,Good Characters,Brown Eyes,Brown Hair,Male Characters,,Deceased Characters,37,Jun-73,1973 1071,Thomas Halloway (Earth-616),\/Thomas_Halloway_(Earth-616),Public Identity,Good Characters,Brown Eyes,White Hair,Male Characters,,Living Characters,135,Oct-39,1939 1072,Simon Halloway (Earth-616),\/Simon_Halloway_(Earth-616),Public Identity,Good Characters,,,Male Characters,,Living Characters,4,Oct-91,1991 1073,Warren Worthington III (Earth-616),\/Warren_Worthington_III_(Earth-616),Public Identity,Good Characters,Blue Eyes,Blond Hair,Male Characters,,Living Characters,1230,Sep-63,1963 1075,Ani-Mator (Earth-616),\/Ani-Mator_(Earth-616),Secret Identity,Bad Characters,Blue Eyes,Bald,Male Characters,,Deceased Characters,8,Jan-88,1988 1078,Annihilus (Earth-616),\/Annihilus_(Earth-616),No Dual Identity,Neutral Characters,Green Eyes,No Hair,Male Characters,,Living Characters,125,Nov-68,1968 1080,Scott Lang (Earth-616),\/Scott_Lang_(Earth-616),Public Identity,Good Characters,Blue Eyes,Strawberry Blond Hair,Male Characters,,Living Characters,209,Mar-79,1979 1081,John Anvil (Earth-616),\/John_Anvil_(Earth-616),Public Identity,Bad Characters,Blue Eyes,Blond Hair,Male Characters,,Deceased Characters,7,Dec-74,1974 1084,En Sabah Nur (Earth-616),\/En_Sabah_Nur_(Earth-616),Public Identity,Bad Characters,Red Eyes,Black Hair,Male Characters,,Deceased Characters,160,Jun-86,1986

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_2

Step: 3

blur-text-image_3

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

Statistical And Scientific Database Management International Working Conference Ssdbm Rome Italy June 21 23 1988 Proceedings Lncs 339

Authors: Maurizio Rafanelli ,John C. Klensin ,Per Svensson

1st Edition

354050575X, 978-3540505754

More Books

Students also viewed these Databases questions

Question

=+2. Who are your colleagues?

Answered: 1 week ago