Message Boards Message Boards

0
|
6625 Views
|
4 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Basic commands on this table won't work

Posted 11 years ago
Hello everyone

I have the following dataset and I want to work with it:
  dataHollywood = {{{}}, {{
      "Movie ", "Opening Gross ", "Total U.S. Gross ",
       "Total Non-U.S. Gross ", "Budget", "Opening Theatres",
       "Known Story", "Sequel", " Origin_United States", "Genre",
       "Summer", "Holiday", "Christmas", "MPAA", "MPAA_D",
       "Critics\.b4 Opinion", "Oscar Nominations", "Oscars Won"}, {
      "16 Blocks", 1.185526*^7, 3.6895141*^7, 6.5664721*^7, 4.5*^7,
       2706., 0., 0., 1., "Action ", 1., 0., 0., "PG-13", 0., 63., 0.,
       0.}, {"Accepted", 1.0023835*^7, 3.6323505*^7, 2.146261*^6,
      2.3*^7, 2914., 0., 0., 1., "Comedy", 0., 0., 0., "PG-13", 0.,
      47., 0., 0.}, {
     "Apocalypto", 1.5005604*^7, 5.0866635*^7, 6.9309076*^7, 4.*^7,
      2465., 0., 0., 1., "Adventure", 0., 0., 0., "R", 1., 68., 3.,
      0.}, {"Arthur and the Invisibles", 4.294936*^6, 1.5132763*^7,
      9.7854413*^7, 8.6*^7, 2247., 0., 0., 0., "Animation", 1., 0., 0.,
       "PG", 0., 39., 0., 0.}, {
     "ATL", 1.1554404*^7, 2.1170563*^7, 0., 2.*^7, 1602., 0., 0., 1.,
      "Drama", 0., 0., 0., "PG-13", 0., 63., 0., 0.}, {
     "Babel", 5.558095*^6, 3.4302837*^7, 1.01027326*^8, 2.*^7, 1251.,
      0., 0., 1., "Drama", 0., 0., 0., "R", 1., 69., 7., 1.}, {
     "Barnyard: The Original Party Animals", 1.5820864*^7,
      7.2637803*^7, 4.3272126*^7, 5.1*^7, 3311., 0., 0., 1.,
      "Animation", 1., 0., 0., "PG", 0., 42., 0., 0.}, {
     "Big Momma's House 2", 2.7736056*^7, 7.0165972*^7, 6.8079671*^7,
      4.*^7, 3261., 0., 1., 1., "Comedy", 0., 1., 1., "PG-13", 0., 34.,
       0., 0.}, {
     "Blood Diamond", 8.648324*^6, 5.7377916*^7, 1.71407179*^8, 1.*^8,
      1910., 0., 0., 1., "Drama", 0., 0., 1., "R", 1., 63., 5., 0.}, {
     "Charlotte's Web", 1.1457353*^7, 8.2599768*^7, 6.1768463*^7,
      8.5*^7, 3566., 1., 0., 1., "Comedy", 0., 0., 0., "G", 0., 68.,
      0., 0.}, {
     "Children of Men", 1.0197775*^7, 3.5327768*^7, 3.3897819*^7,
      7.6*^7, 1209., 1., 0., 0., "Thriller", 0., 0., 0., "R", 1., 84.,
      3., 0.}, {
     "Click", 4.0011365*^7, 1.37355633*^8, 1.00325666*^8, 8.25*^7,
      3749., 0., 0., 1., "Comedy", 1., 0., 0., "PG-13", 0., 45., 1.,
      0.}, {"Curious George", 1.4703405*^7, 5.836076*^7, 1.1474055*^7,
      5.*^7, 2566., 1., 0., 1., "Animation", 0., 0., 0., "G", 0., 62.,
      0., 0.}, {
     "Date Movie", 1.9076261*^7, 4.8548426*^7, 3.624723*^7, 2.*^7,
      2896., 0., 0., 1., "Comedy", 0., 0., 0., "PG-13", 0., 11., 0.,
      0.}, {"Deja Vu", 2.0574802*^7, 6.4038616*^7, 1.16518934*^8,
      7.5*^7, 3108., 0., 0., 1., "Thriller", 1., 1., 0., "PG-13", 0.,
      59., 0., 0.}, {
     "Dreamgirls", 8.953734*^6, 1.03365956*^8, 5.120091*^7, 7.5*^7,
      852., 0., 0., 1., "Drama", 0., 0., 0., "PG-13", 0., 76., 8.,
      2.}, {"Eight Below", 2.0188176*^7, 8.1612565*^7, 3.8843429*^7,
      4.*^7, 3066., 1., 0., 1., "Drama", 0., 1., 0., "PG", 0., 64., 0.,
       0.}, {"Eragon", 2.3239907*^7, 7.5030163*^7, 1.74390688*^8,
      1.*^8, 3020., 1., 0., 1., "Action", 0., 0., 0., "PG", 0., 38.,
      0., 0.}, {
     "Failure to Launch", 2.4411322*^7, 8.8715192*^7, 3.9691695*^7,
      5.*^7, 3057., 0., 0., 1., "Comedy", 0., 0., 0., "PG-13", 0., 47.,
       0., 0.}, {
     "Final Destination 3", 1.9173094*^7, 5.4098051*^7, 5.9172557*^7,
      2.5*^7, 2880., 0., 1., 1., "Horror", 0., 0., 0., "R", 1., 41.,
      0., 0.}, {
     "Flags of Our Fathers", 1.024519*^7, 3.3602376*^7, 3.2297873*^7,
      9.*^7, 1876., 1., 0., 1., "Action", 1., 0., 0., "R", 1., 79., 2.,
       0.}, {"Flyboys", 6.004219*^6, 1.309063*^7, 4.679984*^6, 6.*^7,
      2033., 0., 0., 0., "Action", 1., 0., 0., "PG-13", 0., 47., 0.,
      0.}, {"Gridiron Gang", 1.441463*^7, 3.8432823*^7, 3.048028*^6,
      3.*^7, 3504., 0., 0., 1., "Drama", 0., 0., 0., "PG-13", 0., 52.,
      0., 0.}, {
     "Happy Feet", 4.1533432*^7, 1.98000317*^8, 1.86330162*^8, 1.*^8,
      3804., 0., 0., 0., "Animation", 1., 0., 0., "PG", 0., 77., 1.,
      1.}, {"Ice Age: The Meltdown", 6.8033544*^7, 1.95330621*^8,
      4.56235122*^8, 8.*^7, 3964., 0., 1., 1., "Animation", 0., 0., 0.,
       "PG", 0., 58., 0., 0.}, {
     "Inside Man", 2.8954945*^7, 8.8513495*^7, 9.5862759*^7, 4.5*^7,
      2818., 0., 0., 1., "Thriller", 0., 0., 0., "R", 1., 76., 0.,
      0.}, {"Just My Luck", 5.692285*^6, 1.732665*^7, 2.0750723*^7,
      2.8*^7, 2541., 0., 0., 1., "Comedy", 1., 1., 0., "PG-13", 0.,
      29., 0., 0.}, {
     "Lady in the Water", 1.8044396*^7, 4.2285169*^7, 3.05*^7, 7.*^7,
      3235., 0., 0., 1., "Drama", 0., 0., 0., "PG-13", 0., 36., 0.,
      0.}, {"Last Holiday", 1.2806188*^7, 3.8399961*^7, 4.943287*^6,
      4.5*^7, 2514., 1., 0., 1., "Drama", 0., 0., 1., "PG-13", 0., 52.,
       0., 0.}, {
     "Little Man", 2.1613176*^7, 5.8645052*^7, 4.2950069*^7, 6.4*^7,
      2533., 0., 0., 1., "Comedy", 0., 0., 0., "PG-13", 0., 26., 0.,
      0.}, {"Lucky Number Slevin", 7.031921*^6, 2.2495466*^7,
      3.3813415*^7, 2.7*^7, 1984., 0., 0., 1., "Thriller", 0., 0., 0.,
      "R", 1., 53., 0., 0.}, {
     "Marie Antoinette", 5.36105*^6, 1.5962471*^7, 4.4954718*^7, 4.*^7,
       859., 1., 0., 1., "Drama", 1., 0., 0., "PG-13", 0., 65., 1.,
      1.}, {"Monster House", 2.2217226*^7, 7.366101*^7, 6.6513996*^7,
      7.5*^7, 3553., 0., 0., 1., "Adventure", 1., 0., 0., "PG", 0.,
      68., 1., 0.}, {
     "Nacho Libre", 2.8309599*^7, 8.0197993*^7, 1.9057467*^7, 3.5*^7,
      3070., 0., 0., 1., "Comedy", 0., 0., 0., "PG", 0., 52., 0.,
      0.}, {"Nanny McPhee", 1.450365*^7, 4.714411*^7, 7.5345712*^7,
      2.5*^7, 1995., 1., 0., 0., "Comedy", 0., 0., 0., "PG", 0., 59.,
      0., 0.}, {
     "One Night with the King", 4.120497*^6, 1.3395961*^7, 142621.,
      2.*^7, 909., 1., 0., 1., "Drama", 0., 0., 0., "PG", 0., 38., 0.,
      0.}, {"Open Season", 2.3624548*^7, 8.4303558*^7, 1.04784721*^8,
      8.5*^7, 3833., 0., 0., 1., "Animation", 0., 0., 0., "PG", 0.,
      49., 0., 0.}, {
    "Pulse", 8.203822*^6, 2.0264436*^7, 9.507049*^6, 2.05*^7, 2323.,
     1., 0., 1., "Horror", 0., 1., 1., "PG-13", 0., 27., 0., 0.}, {
    "Rocky Balboa", 1.2158168*^7, 7.0269899*^7, 8.541899*^7, 2.4*^7,
     3017., 0., 1., 1., "Drama", 1., 0., 0., "PG", 0., 63., 0., 0.}, {
    "RV", 1.6414767*^7, 7.1726025*^7, 1.5802148*^7, 5.*^7, 3639., 0.,
     0., 0., "Comedy", 0., 0., 0., "PG", 0., 33., 0., 0.}, {
    "Scary Movie 4", 4.0222875*^7, 9.071062*^7, 8.7552*^7, 4.5*^7,
     3602., 0., 1., 1., "Horror ", 1., 0., 0., "PG-13", 0., 40., 0.,
     0.}, {"School for Scoundrels", 8.602333*^6, 1.7807569*^7,
     5.82619*^6, 3.5*^7, 3004., 1., 0., 1., "Comedy", 1., 0., 0.,
     "PG-13", 0., 44., 0., 0.}, {
    "She's the Man", 1.0730372*^7, 3.3741133*^7, 2.3453534*^7, 2.*^7,
     2623., 1., 0., 1., "Comedy", 0., 0., 0., "PG-13", 0., 45., 0.,
     0.}, {"Silent Hill", 2.0152598*^7, 4.6982632*^7, 5.0624821*^7,
     5.*^7, 2926., 1., 0., 0., "Horror", 0., 1., 1., "R", 1., 30., 0.,
      0.}, {"Snakes on a Plane", 1.3806311*^7, 3.4020814*^7,
     2.80012*^7, 3.3*^7, 3555., 0., 0., 1., "Thriller", 1., 0., 0.,
     "R", 1., 58., 0., 0.}, {
    "Stay Alive", 1.0726406*^7, 2.308648*^7, 4.018615*^6, 2.*^7,
     2009., 0., 0., 1., "Horror", 0., 0., 0., "PG-13", 0., 24., 0.,
     0.}, {"Stick It", 1.080361*^7, 2.6910736*^7, 5.066112*^6, 2.*^7,
     2038., 0., 0., 1., "Action", 0., 0., 0., "PG-13", 0., 53., 0.,
     0.}, {"Stranger Than Fiction", 1.3411093*^7, 4.043519*^7,
     1.2992229*^7, 3.*^7, 2264., 0., 0., 1., "Comedy", 1., 0., 0.,
     "PG", 0., 67., 0., 0.}, {
    "Take the Lead", 1.2051277*^7, 3.4742066*^7, 3.1000312*^7, 3.*^7,
     3009., 0., 0., 1., "Drama", 0., 0., 0., "PG-13", 0., 55., 0.,
     0.}, {"Talladega Nights: The Ballad of Ricky Bobby",
     4.7042215*^7, 1.48213377*^8, 1.47528*^7, 7.25*^7, 3803., 0., 0.,
     1., "Comedy", 0., 0., 0., "PG-13", 0., 66., 0., 0.}, {
    "The Ant Bully", 8.432465*^6, 2.8142535*^7, 2.7038594*^7, 5.*^7,
     3050., 1., 0., 1., "Animation", 0., 0., 0., "PG", 0., 59., 0.,
     0.}, {"The Benchwarmers", 1.9656429*^7, 5.9843754*^7,
     5.113537*^6, 3.3*^7, 3274., 0., 0., 1., "Comedy", 0., 0., 0.,
     "PG-13", 0., 25., 0., 0.}, {
    "The Black Dahlia", 1.0005895*^7, 2.254508*^7, 2.6698333*^7,
     5.*^7, 2226., 1., 0., 0., "Drama", 0., 0., 0., "R", 1., 49., 1.,
     0.}, {
    "The Break-Up", 3.9172785*^7, 1.18703275*^8, 8.6259809*^7, 5.2*^7,
      3070., 0., 0., 1., "Comedy", 0., 0., 0., "PG-13", 0., 45., 0.,
     0.}, {"The Covenant", 8.852458*^6, 2.3380495*^7, 1.4216976*^7,
     2.*^7, 2681., 0., 0., 1., "Horror", 0., 0., 0., "PG-13", 0., 19.,
      0., 0.}, {
    "The Departed", 2.6887467*^7, 1.32384315*^8, 1.57463039*^8, 9.*^7,
      3017., 1., 0., 1., "Drama", 0., 0., 1., "R", 1., 86., 5., 4.}, {
    "The Devil Wears Prada", 2.7537244*^7, 1.2474046*^8,
     2.01568618*^8, 3.5*^7, 2847., 1., 0., 1., "Comedy", 0., 0., 0.,
     "PG-13", 0., 62., 2., 0.}, {
    "The Grudge 2", 2.08253*^7, 3.9143839*^7, 3.1567336*^7, 2.*^7,
     3211., 0., 1., 0., "Horror", 1., 0., 0., "PG-13", 0., 33., 0.,
     0.}, {"The Holiday", 1.2778913*^7, 6.3224849*^7, 1.41910326*^8,
     8.5*^7, 2610., 0., 0., 1., "Comedy", 1., 1., 0., "PG-13", 0.,
     52., 0., 0.}, {
    "The Lake House", 1.3616196*^7, 5.2330111*^7, 6.25*^7, 4.*^7,
     2645., 1., 0., 1., "Drama", 1., 0., 0., "PG", 0., 52., 0., 0.}, {
    "The Nativity Story", 7.849304*^6, 3.7629831*^7, 8.79956*^6,
     3.5*^7, 3083., 1., 0., 1., "Drama", 0., 0., 0., "PG", 0., 52.,
     0., 0.}, {
    "The Omen (2006)", 1.6026496*^7, 5.4607383*^7, 6.4891526*^7,
     2.5*^7, 2723., 1., 0., 1., "Horror", 0., 0., 0., "R", 1., 43.,
     0., 0.}, {
    "The Pink Panther", 2.0220412*^7, 8.2226474*^7, 7.6624883*^7,
     8.*^7, 3477., 1., 1., 1., "Comedy", 0., 0., 0., "PG", 0., 38.,
     0., 0.}, {
    "The Prestige", 1.4801808*^7, 5.3089891*^7, 5.658642*^7, 4.*^7,
     2281., 1., 0., 1., "Drama", 0., 0., 0., "PG-13", 0., 66., 2.,
     0.}, {"The Pursuit of Happyness", 2.6541709*^7, 1.63566459*^8,
     1.43373994*^8, 5.5*^7, 2852., 0., 0., 1., "Drama", 1., 0., 0.,
     "PG-13", 0., 64., 1., 0.}, {
    "The Sentinel", 1.4367854*^7, 3.6280697*^7, 4.1639649*^7, 6.*^7,
     2819., 1., 0., 1., "Action ", 1., 0., 0., "PG-13", 0., 48., 0.,
     0.}, {"The Shaggy Dog", 1.6310058*^7, 6.1123569*^7, 2.6010711*^7,
      6.*^7, 3501., 1., 0., 1., "Comedy", 0., 0., 0., "PG", 0., 43.,
     0., 0.}, {
    "The Wicker Man", 9.610204*^6, 2.3649127*^7, 1.5064046*^7, 4.*^7,
     2784., 1., 0., 1., "Thriller", 1., 0., 0., "PG-13", 0., 36., 0.,
     0.}, {"The Wild", 9.684809*^6, 3.7384046*^7, 6.4954469*^7, 8.*^7,
      2854., 0., 0., 1., "Animation", 0., 0., 1., "G", 0., 47., 0.,
     0.}, {"Ultraviolet", 9.06488*^6, 1.8535812*^7, 1.2534399*^7,
     3.*^7, 2558., 0., 0., 1., "Action", 0., 0., 1., "PG-13", 0., 18.,
      0., 0.}, {
    "Unaccompanied Minors", 5.815474*^6, 1.6655224*^7, 5.29399*^6,
     2.5*^7, 2775., 0., 0., 1., "Comedy", 1., 0., 0., "PG", 0., 43.,
     0., 0.}, {
    "Underworld: Evolution", 2.6857181*^7, 6.2318875*^7, 4.9021926*^7,
      4.5*^7, 3207., 0., 1., 1., "Horror", 0., 0., 0., "R", 1., 36.,
     0., 0.}, {
    "V for Vendetta", 2.564234*^7, 7.0511035*^7, 6.2*^7, 5.4*^7,
     3365., 1., 0., 0., "Action ", 0., 0., 0., "R", 1., 62., 0.,
     0.}, {"World Trade Center", 1.8730762*^7, 7.0278893*^7,
     9.2691347*^7, 6.5*^7, 2957., 0., 0., 1., "Drama", 0., 0., 0.,
     "PG-13", 0., 66., 0., 0.}, {
    "You, Me and Dupree", 2.152556*^7, 7.562811*^7, 5.4731328*^7,
     5.4*^7, 3131., 0., 0., 1., "Comedy", 0., 0., 0., "PG-13", 0.,
     46., 0., 0.}}};
dataHollywood // TableForm
I worked several times with such datasets but this one seems to be different. I first wanted to transpose it, but with no success. I then tried simpler commands like "lenght" and I get a result of 2 which can't be. Can someone explain me please what I'm doing wrong?
4 Replies
Posted 11 years ago
add this to the last comand

dataHollywood[[2]]//TableForm

That will select the second part of the 2 part list.

Paul.
POSTED BY: Paul Cleary
Posted 11 years ago
Try removing the first set of braces  {{{}}, from the beginning and also the last } at the end and try it again, it seems ok to me then and it reads length 76 then

Paul.
POSTED BY: Paul Cleary
dataHollywood=<<Hollywood Rules dataset>>;
dataHollywood//TableForm
How can I remove the braces from the data? In Mathematica I have to use the command from above and only work with this. I can't "manually" delete the braces.
This worked, thank you very much!
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract