Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Pandas merge question
I hope you are all having a good day. I want to know why my merge below is returning the key error that is stated below my code. Any help would be appreciated.

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline






KeyError: 'months'
Your example works for me. Perhaps you forgot to run line 15 (that renames month column as months column), so there was no 'months' key in df1 and merge failed?

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Counting Criteria in Pandas Question Koenig 1 144 Sep-30-2019, 05:16 AM
Last Post: perfringo
  Function question using Pandas smw10c 7 2,758 Feb-12-2019, 06:52 PM
Last Post: Nathandsn
  Simple pandas dataframe question popohoma 1 596 Jan-03-2019, 05:00 PM
Last Post: ashlardev
  Why can't I merge pandas dataframes learnpython2018 2 1,061 Sep-23-2018, 05:53 PM
Last Post: learnpython2018
  question on pandas datareader kit12_31 3 4,265 Feb-05-2018, 11:55 PM
Last Post: snippsat
  Newbie question on how to use pandas.rolling_mean zydjohn 5 7,915 Dec-09-2017, 08:42 PM
Last Post: j.crater
  Pandas question takaa 3 1,308 Dec-05-2017, 01:03 PM
Last Post: takaa

Forum Jump:

Users browsing this thread: 1 Guest(s)