# Leftjoin changes the type of my dataframe columns from Float64 to Float64?

**URL:** <https://discourse.julialang.org/t/leftjoin-changes-the-type-of-my-dataframe-columns-from-float64-to-float64/94839>\
**Category:** Data\
**Tags:** question\
**Created:** [February 18, 2023, 2:57pm UTC](https://discourse.julialang.org/t/leftjoin-changes-the-type-of-my-dataframe-columns-from-float64-to-float64/94839 "2023-02-18T14:57:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dlshew19](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlshew19/32/38751_2.png) [@dlshew19](https://discourse.julialang.org/u/dlshew19)\
**Post date:** [February 18, 2023, 2:57pm UTC](https://discourse.julialang.org/t/leftjoin-changes-the-type-of-my-dataframe-columns-from-float64-to-float64/94839/1 "2023-02-18T14:57:22Z")

</div>

I have a dataframe where the output is this:  
Row │ TeamName OffTOPct OffRPct OffFTRate  
│ String31 Float64 Float64 Float64  
─────┼─────────────────────────────────────────────────  
1 │ Abilene Christian 17.6662 27.9271 39.2743  
2 │ Air Force 21.4742 19.5677 26.7919  
3 │ Akron 17.8053 28.9216 39.3029

I run this code,  
leftjoin!(SummaryPre22, Off22, on=:TeamName, makeunique=true)

to join it with a df that looks like this  
Row │ TeamName Conf Tempo OE AdjOE DE AdjDE AdjEM  
│ String31 String7 Float64 Float64 Float64 Float64 Float64 Float64  
─────┼─────────────────────────────────────────────────────────────────────────────────────────  
1 │ Abilene Christian WAC 70.9837 101.622 102.991 95.5159 99.3582 3.6328

But I get a df in return with Float64? as my column types in return.  
Row │ TeamName Conf Tempo OE AdjOE DE AdjDE AdjEM OffTOPct OffRPct OffFTRate DefTOPct DefRPct DefFTRate Off2Pct Off3Pct OffFTPct Bl ⋯  
│ String31 String7 Float64 Float64 Float64 Float64 Float64 Float64 Float64? Float64? Float64? Float64? Float64? Float64? Float64? Float64? Float64? Fl ⋯  
─────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────  
1 │ Abilene Christian WAC 70.9837 101.622 102.991 95.5159 99.3582 3.6328 17.6662 27.9271 39.2743 27.8848 30.9184 49.1228 48.4087 32.2059 74.8641

This gives me an error later on:ERROR: LoadError: ArgumentError: column(s) OffTOPct and OffRPct are missing from argument(s) 2, 3, 4 and 5

I’m guessing it’s because of the type of those columns as Float64. I was wondering if anyone knew why joining the data frames would change the type like that?

---

<div class="post-metadata">

**Author:** ![bkamins](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bkamins/32/208538_2.png) [@bkamins](https://discourse.julialang.org/u/bkamins)\
**Post date:** [February 18, 2023, 4:51pm UTC](https://discourse.julialang.org/t/leftjoin-changes-the-type-of-my-dataframe-columns-from-float64-to-float64/94839/2 "2023-02-18T16:51:26Z")

</div>

The reason is that it is not guaranteed that for all keys in left table there are matching keys in right table.

To remove `Missing` union use the `disallowmissing!` function after join.
