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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "95956dfc-c447-4dcb-a3c4-563ec91e9211",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "8724a364-ae3a-41a1-9b4a-68d53c452d83",
   "metadata": {},
   "outputs": [],
   "source": [
    "infile = \"/Users/carolanderson/Dropbox/Existing2022CardInventoryWithNewBoxes2023.txt\"\n",
    "df= pd.read_csv(infile, sep=\"\\t\", encoding=\"ISO-8859-1\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "660ed1bf-cf66-495e-a829-cfe37861aa3f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Type</th>\n",
       "      <th>Sport</th>\n",
       "      <th>Year</th>\n",
       "      <th>Company</th>\n",
       "      <th>Product</th>\n",
       "      <th>Card #</th>\n",
       "      <th>Player Name</th>\n",
       "      <th>Notes</th>\n",
       "      <th>HOF</th>\n",
       "      <th>Grader</th>\n",
       "      <th>Grade</th>\n",
       "      <th>Storage Box</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Card</td>\n",
       "      <td>Baseball</td>\n",
       "      <td>1949</td>\n",
       "      <td>Leaf</td>\n",
       "      <td>NaN</td>\n",
       "      <td>68</td>\n",
       "      <td>Eddie Miller</td>\n",
       "      <td>SP</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Beckett</td>\n",
       "      <td>3.0</td>\n",
       "      <td>270.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Card</td>\n",
       "      <td>Baseball</td>\n",
       "      <td>1949</td>\n",
       "      <td>Leaf</td>\n",
       "      <td>NaN</td>\n",
       "      <td>48</td>\n",
       "      <td>Johnny Schmitz</td>\n",
       "      <td>SP</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Beckett</td>\n",
       "      <td>3.0</td>\n",
       "      <td>270.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Card</td>\n",
       "      <td>Baseball</td>\n",
       "      <td>1961</td>\n",
       "      <td>Topps</td>\n",
       "      <td>NaN</td>\n",
       "      <td>575</td>\n",
       "      <td>Ernie Banks</td>\n",
       "      <td>AS</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Beckett</td>\n",
       "      <td>4.5</td>\n",
       "      <td>269.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Card</td>\n",
       "      <td>Baseball</td>\n",
       "      <td>1949</td>\n",
       "      <td>Leaf</td>\n",
       "      <td>NaN</td>\n",
       "      <td>129</td>\n",
       "      <td>Kirby Higbe</td>\n",
       "      <td>SP</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Beckett</td>\n",
       "      <td>1.5</td>\n",
       "      <td>270.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Card</td>\n",
       "      <td>Baseball</td>\n",
       "      <td>1999</td>\n",
       "      <td>Topps</td>\n",
       "      <td>All-Topps Mystery Finest</td>\n",
       "      <td>M3</td>\n",
       "      <td>Mark McGwire</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Beckett</td>\n",
       "      <td>9.0</td>\n",
       "      <td>270.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Type     Sport  Year Company                   Product Card #  \\\n",
       "0  Card  Baseball  1949    Leaf                       NaN     68   \n",
       "1  Card  Baseball  1949    Leaf                       NaN     48   \n",
       "2  Card  Baseball  1961   Topps                       NaN    575   \n",
       "3  Card  Baseball  1949    Leaf                       NaN    129   \n",
       "4  Card  Baseball  1999   Topps  All-Topps Mystery Finest     M3   \n",
       "\n",
       "      Player Name Notes  HOF   Grader  Grade  Storage Box  \n",
       "0    Eddie Miller    SP  NaN  Beckett    3.0        270.0  \n",
       "1  Johnny Schmitz    SP  NaN  Beckett    3.0        270.0  \n",
       "2     Ernie Banks    AS  NaN  Beckett    4.5        269.0  \n",
       "3     Kirby Higbe    SP  NaN  Beckett    1.5        270.0  \n",
       "4    Mark McGwire   NaN  NaN  Beckett    9.0        270.0  "
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "d37f49f3-8fca-42db-a148-b0d0c37c9c04",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Type</th>\n",
       "      <th>Sport</th>\n",
       "      <th>Year</th>\n",
       "      <th>Company</th>\n",
       "      <th>Product</th>\n",
       "      <th>Card #</th>\n",
       "      <th>Player Name</th>\n",
       "      <th>Notes</th>\n",
       "      <th>HOF</th>\n",
       "      <th>Grader</th>\n",
       "      <th>Grade</th>\n",
       "      <th>Storage Box</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>55</th>\n",
       "      <td>Card</td>\n",
       "      <td>Baseball</td>\n",
       "      <td>1952</td>\n",
       "      <td>Bowman</td>\n",
       "      <td>NaN</td>\n",
       "      <td>11</td>\n",
       "      <td>Ralph Kiner</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Y</td>\n",
       "      <td>Beckett</td>\n",
       "      <td>3.0</td>\n",
       "      <td>271.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>403</th>\n",
       "      <td>Card</td>\n",
       "      <td>Baseball</td>\n",
       "      <td>1953</td>\n",
       "      <td>Bowman</td>\n",
       "      <td>Color</td>\n",
       "      <td>80</td>\n",
       "      <td>Ralph Kiner</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>314</th>\n",
       "      <td>Card</td>\n",
       "      <td>Baseball</td>\n",
       "      <td>1949</td>\n",
       "      <td>Leaf</td>\n",
       "      <td>NaN</td>\n",
       "      <td>61</td>\n",
       "      <td>Jake Early</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>179</th>\n",
       "      <td>Card</td>\n",
       "      <td>Baseball</td>\n",
       "      <td>1985</td>\n",
       "      <td>Topps</td>\n",
       "      <td>NaN</td>\n",
       "      <td>401</td>\n",
       "      <td>Mark McGwire</td>\n",
       "      <td>Rookie</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Sportscard Guaranty</td>\n",
       "      <td>86.0</td>\n",
       "      <td>268.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>492</th>\n",
       "      <td>Card</td>\n",
       "      <td>Baseball</td>\n",
       "      <td>1952</td>\n",
       "      <td>Bowman</td>\n",
       "      <td>NaN</td>\n",
       "      <td>122</td>\n",
       "      <td>Joe Garagiola</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>315</th>\n",
       "      <td>Card</td>\n",
       "      <td>Baseball</td>\n",
       "      <td>1948</td>\n",
       "      <td>Leaf</td>\n",
       "      <td>NaN</td>\n",
       "      <td>49</td>\n",
       "      <td>Del Ennis</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>109</th>\n",
       "      <td>Card</td>\n",
       "      <td>Baseball</td>\n",
       "      <td>1949</td>\n",
       "      <td>Leaf</td>\n",
       "      <td>NaN</td>\n",
       "      <td>62</td>\n",
       "      <td>Eddie Joost</td>\n",
       "      <td>SP</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Beckett</td>\n",
       "      <td>2.5</td>\n",
       "      <td>270.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>66</th>\n",
       "      <td>Card</td>\n",
       "      <td>Baseball</td>\n",
       "      <td>1949</td>\n",
       "      <td>Leaf</td>\n",
       "      <td>NaN</td>\n",
       "      <td>113</td>\n",
       "      <td>Dutch Leonard</td>\n",
       "      <td>SP</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Beckett</td>\n",
       "      <td>2.5</td>\n",
       "      <td>268.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>340</th>\n",
       "      <td>Card</td>\n",
       "      <td>Basketball</td>\n",
       "      <td>1994</td>\n",
       "      <td>Competitive Images</td>\n",
       "      <td>NaN</td>\n",
       "      <td>8</td>\n",
       "      <td>Michael Jordan</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>104</th>\n",
       "      <td>Card</td>\n",
       "      <td>Baseball</td>\n",
       "      <td>1949</td>\n",
       "      <td>Leaf</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36</td>\n",
       "      <td>Al Zarilla</td>\n",
       "      <td>SP</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Beckett</td>\n",
       "      <td>2.5</td>\n",
       "      <td>271.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>469</th>\n",
       "      <td>Card</td>\n",
       "      <td>Baseball</td>\n",
       "      <td>1974</td>\n",
       "      <td>Topps</td>\n",
       "      <td>NaN</td>\n",
       "      <td>230</td>\n",
       "      <td>Tony Perez</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>420</th>\n",
       "      <td>Card</td>\n",
       "      <td>Baseball</td>\n",
       "      <td>1951</td>\n",
       "      <td>Bowman</td>\n",
       "      <td>NaN</td>\n",
       "      <td>110</td>\n",
       "      <td>Bobby Brown</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>302</th>\n",
       "      <td>Card</td>\n",
       "      <td>Baseball</td>\n",
       "      <td>2017</td>\n",
       "      <td>Topps</td>\n",
       "      <td>Now</td>\n",
       "      <td>OS-80</td>\n",
       "      <td>Shohei Ohtani</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>197</th>\n",
       "      <td>Card</td>\n",
       "      <td>Baseball</td>\n",
       "      <td>1957</td>\n",
       "      <td>Topps</td>\n",
       "      <td>NaN</td>\n",
       "      <td>25</td>\n",
       "      <td>Whitey Ford</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Sportscard Guaranty</td>\n",
       "      <td>86.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>144</th>\n",
       "      <td>Card</td>\n",
       "      <td>Baseball</td>\n",
       "      <td>1954</td>\n",
       "      <td>Dan-Dee</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3</td>\n",
       "      <td>Walker Cooper</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Beckett</td>\n",
       "      <td>2.0</td>\n",
       "      <td>270.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>481</th>\n",
       "      <td>Card</td>\n",
       "      <td>Baseball</td>\n",
       "      <td>1952</td>\n",
       "      <td>Bowman</td>\n",
       "      <td>NaN</td>\n",
       "      <td>96</td>\n",
       "      <td>Ralph Branca</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>194</th>\n",
       "      <td>Card</td>\n",
       "      <td>Baseball</td>\n",
       "      <td>1987</td>\n",
       "      <td>Fleer</td>\n",
       "      <td>Update Glossy</td>\n",
       "      <td>U-68</td>\n",
       "      <td>Greg Maddux</td>\n",
       "      <td>Rookie</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Sportscard Guaranty</td>\n",
       "      <td>96.0</td>\n",
       "      <td>268.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>123</th>\n",
       "      <td>Card</td>\n",
       "      <td>Baseball</td>\n",
       "      <td>2001</td>\n",
       "      <td>Topps</td>\n",
       "      <td>NaN</td>\n",
       "      <td>726</td>\n",
       "      <td>Ichiro Suzuki</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Beckett</td>\n",
       "      <td>8.0</td>\n",
       "      <td>267.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>224</th>\n",
       "      <td>Card</td>\n",
       "      <td>Baseball</td>\n",
       "      <td>1993</td>\n",
       "      <td>Classic</td>\n",
       "      <td>Best</td>\n",
       "      <td>PR1</td>\n",
       "      <td>Derek Jeter</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>CSA</td>\n",
       "      <td>9.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>358</th>\n",
       "      <td>Card</td>\n",
       "      <td>Baseball</td>\n",
       "      <td>1952</td>\n",
       "      <td>Topps</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36</td>\n",
       "      <td>Gil Hodges</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     Type       Sport  Year             Company        Product Card #  \\\n",
       "55   Card    Baseball  1952              Bowman            NaN     11   \n",
       "403  Card    Baseball  1953              Bowman          Color     80   \n",
       "314  Card    Baseball  1949                Leaf            NaN     61   \n",
       "179  Card    Baseball  1985               Topps            NaN    401   \n",
       "492  Card    Baseball  1952              Bowman            NaN    122   \n",
       "315  Card    Baseball  1948                Leaf            NaN     49   \n",
       "109  Card    Baseball  1949                Leaf            NaN     62   \n",
       "66   Card    Baseball  1949                Leaf            NaN    113   \n",
       "340  Card  Basketball  1994  Competitive Images            NaN      8   \n",
       "104  Card    Baseball  1949                Leaf            NaN     36   \n",
       "469  Card    Baseball  1974               Topps            NaN    230   \n",
       "420  Card    Baseball  1951              Bowman            NaN    110   \n",
       "302  Card    Baseball  2017               Topps            Now  OS-80   \n",
       "197  Card    Baseball  1957               Topps            NaN     25   \n",
       "144  Card    Baseball  1954             Dan-Dee            NaN      3   \n",
       "481  Card    Baseball  1952              Bowman            NaN     96   \n",
       "194  Card    Baseball  1987               Fleer  Update Glossy   U-68   \n",
       "123  Card    Baseball  2001               Topps            NaN    726   \n",
       "224  Card    Baseball  1993             Classic           Best    PR1   \n",
       "358  Card    Baseball  1952               Topps            NaN     36   \n",
       "\n",
       "        Player Name   Notes  HOF               Grader  Grade  Storage Box  \n",
       "55      Ralph Kiner     NaN    Y              Beckett    3.0        271.0  \n",
       "403     Ralph Kiner     NaN  NaN                  NaN    NaN          NaN  \n",
       "314      Jake Early     NaN  NaN                  NaN    NaN          NaN  \n",
       "179    Mark McGwire  Rookie  NaN  Sportscard Guaranty   86.0        268.0  \n",
       "492   Joe Garagiola     NaN  NaN                  NaN    NaN          NaN  \n",
       "315       Del Ennis     NaN  NaN                  NaN    NaN          NaN  \n",
       "109     Eddie Joost      SP  NaN              Beckett    2.5        270.0  \n",
       "66    Dutch Leonard      SP  NaN              Beckett    2.5        268.0  \n",
       "340  Michael Jordan     NaN  NaN                  NaN    NaN          NaN  \n",
       "104      Al Zarilla      SP  NaN              Beckett    2.5        271.0  \n",
       "469      Tony Perez     NaN  NaN                  NaN    NaN          NaN  \n",
       "420     Bobby Brown     NaN  NaN                  NaN    NaN          NaN  \n",
       "302   Shohei Ohtani     NaN  NaN                  NaN    NaN          NaN  \n",
       "197     Whitey Ford     NaN  NaN  Sportscard Guaranty   86.0          NaN  \n",
       "144   Walker Cooper     NaN  NaN              Beckett    2.0        270.0  \n",
       "481    Ralph Branca     NaN  NaN                  NaN    NaN          NaN  \n",
       "194     Greg Maddux  Rookie  NaN  Sportscard Guaranty   96.0        268.0  \n",
       "123   Ichiro Suzuki     NaN  NaN              Beckett    8.0        267.0  \n",
       "224     Derek Jeter     NaN  NaN                  CSA    9.0          NaN  \n",
       "358      Gil Hodges     NaN  NaN                  NaN    NaN          NaN  "
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sample = df[:500].sample(20)\n",
    "sample"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "795ef99b-abd7-4fe8-b56c-1779ebda8d52",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Type</th>\n",
       "      <th>Sport</th>\n",
       "      <th>Year</th>\n",
       "      <th>Company</th>\n",
       "      <th>Product</th>\n",
       "      <th>Card #</th>\n",
       "      <th>Player Name</th>\n",
       "      <th>Notes</th>\n",
       "      <th>HOF</th>\n",
       "      <th>Grader</th>\n",
       "      <th>Grade</th>\n",
       "      <th>Storage Box</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>179</th>\n",
       "      <td>Card</td>\n",
       "      <td>Baseball</td>\n",
       "      <td>1985</td>\n",
       "      <td>Topps</td>\n",
       "      <td>NaN</td>\n",
       "      <td>401</td>\n",
       "      <td>Mark McGwire</td>\n",
       "      <td>Rookie</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Sportscard Guaranty</td>\n",
       "      <td>86.0</td>\n",
       "      <td>268.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>492</th>\n",
       "      <td>Card</td>\n",
       "      <td>Baseball</td>\n",
       "      <td>1952</td>\n",
       "      <td>Bowman</td>\n",
       "      <td>NaN</td>\n",
       "      <td>122</td>\n",
       "      <td>Joe Garagiola</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>315</th>\n",
       "      <td>Card</td>\n",
       "      <td>Baseball</td>\n",
       "      <td>1948</td>\n",
       "      <td>Leaf</td>\n",
       "      <td>NaN</td>\n",
       "      <td>49</td>\n",
       "      <td>Del Ennis</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>109</th>\n",
       "      <td>Card</td>\n",
       "      <td>Baseball</td>\n",
       "      <td>1949</td>\n",
       "      <td>Leaf</td>\n",
       "      <td>NaN</td>\n",
       "      <td>62</td>\n",
       "      <td>Eddie Joost</td>\n",
       "      <td>SP</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Beckett</td>\n",
       "      <td>2.5</td>\n",
       "      <td>270.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>66</th>\n",
       "      <td>Card</td>\n",
       "      <td>Baseball</td>\n",
       "      <td>1949</td>\n",
       "      <td>Leaf</td>\n",
       "      <td>NaN</td>\n",
       "      <td>113</td>\n",
       "      <td>Dutch Leonard</td>\n",
       "      <td>SP</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Beckett</td>\n",
       "      <td>2.5</td>\n",
       "      <td>268.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>340</th>\n",
       "      <td>Card</td>\n",
       "      <td>Basketball</td>\n",
       "      <td>1994</td>\n",
       "      <td>Competitive Images</td>\n",
       "      <td>NaN</td>\n",
       "      <td>8</td>\n",
       "      <td>Michael Jordan</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>104</th>\n",
       "      <td>Card</td>\n",
       "      <td>Baseball</td>\n",
       "      <td>1949</td>\n",
       "      <td>Leaf</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36</td>\n",
       "      <td>Al Zarilla</td>\n",
       "      <td>SP</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Beckett</td>\n",
       "      <td>2.5</td>\n",
       "      <td>271.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     Type       Sport  Year             Company Product Card #  \\\n",
       "179  Card    Baseball  1985               Topps     NaN    401   \n",
       "492  Card    Baseball  1952              Bowman     NaN    122   \n",
       "315  Card    Baseball  1948                Leaf     NaN     49   \n",
       "109  Card    Baseball  1949                Leaf     NaN     62   \n",
       "66   Card    Baseball  1949                Leaf     NaN    113   \n",
       "340  Card  Basketball  1994  Competitive Images     NaN      8   \n",
       "104  Card    Baseball  1949                Leaf     NaN     36   \n",
       "\n",
       "        Player Name   Notes  HOF               Grader  Grade  Storage Box  \n",
       "179    Mark McGwire  Rookie  NaN  Sportscard Guaranty   86.0        268.0  \n",
       "492   Joe Garagiola     NaN  NaN                  NaN    NaN          NaN  \n",
       "315       Del Ennis     NaN  NaN                  NaN    NaN          NaN  \n",
       "109     Eddie Joost      SP  NaN              Beckett    2.5        270.0  \n",
       "66    Dutch Leonard      SP  NaN              Beckett    2.5        268.0  \n",
       "340  Michael Jordan     NaN  NaN                  NaN    NaN          NaN  \n",
       "104      Al Zarilla      SP  NaN              Beckett    2.5        271.0  "
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sample[3:10]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "58a90d8e-0480-4187-a7eb-cd69463c0329",
   "metadata": {},
   "outputs": [],
   "source": [
    "outfile = \"sample_data/sample_data_1.txt\"\n",
    "sample[3:13].to_csv(outfile, sep=\"\\t\", index=False, encoding=\"utf-8\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "31083cda-058b-4aee-b0d5-965e48c4bca7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>animal</th>\n",
       "      <th>coat pattern</th>\n",
       "      <th>Quantity</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Leopard</td>\n",
       "      <td>spots</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Tiger</td>\n",
       "      <td>stripes</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Lion</td>\n",
       "      <td>solid</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Cheetah</td>\n",
       "      <td>spots</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    animal coat pattern  Quantity\n",
       "0  Leopard        spots         2\n",
       "1    Tiger      stripes        10\n",
       "2     Lion        solid         1\n",
       "3  Cheetah        spots         1"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df2 = pd.DataFrame([{\"animal\": \"Leopard\", \"coat pattern\": \"spots\", \"Quantity\" : 2},\n",
    "                     {\"animal\": \"Tiger\", \"coat pattern\": \"stripes\", \"Quantity\" : 10},\n",
    "                     {\"animal\" : \"Lion\", \"coat pattern\" : \"solid\", \"Quantity\" : 1},\n",
    "                     {\"animal\" : \"Cheetah\", \"coat pattern\" : \"spots\", \"Quantity\" : 1}])\n",
    "\n",
    "df2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "bc9735c0-e12a-4b1f-8cb2-7501d37a4c19",
   "metadata": {},
   "outputs": [],
   "source": [
    "outfile = \"sample_data/sample_data_2.txt\"\n",
    "df2.to_csv(outfile, sep=\"\\t\", index=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "ed438bbb-03f4-44a9-8f14-9390f3996cae",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\"animal\" in df2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "36d5bb2e-cc1e-4afa-bff9-730832e9a5ae",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "dtype('int64')"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df3 = pd.read_csv(\"sample_data/sample_data_1.txt\", sep=\"\\t\", encoding=\"ISO-8859-1\" )\n",
    "df3.Year.dtype"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "905c63e9-3d06-4905-ac63-3e66bf94c22e",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python [conda env:rebalance] *",
   "language": "python",
   "name": "conda-env-rebalance-py"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}