Quantcast
Channel: ValueError: Shape of passed values is (1, 6), indices imply (6, 6) - Stack Overflow
Viewing all articles
Browse latest Browse all 5

Answer by rafaelc for ValueError: Shape of passed values is (1, 6), indices imply (6, 6)

$
0
0

Simply change

col = pd.DataFrame(data, columns=['runs','balls', 'wickets', 'ground_average', 'pp_balls_left', 'total_overs'])

for

col = pd.DataFrame([data], columns=['runs','balls', 'wickets', 'ground_average', 'pp_balls_left', 'total_overs'])

You want [data] for pandas to understand they're rows.


Simple illustration:

a = [1, 2, 3]>>> pd.DataFrame(a)   00  11  22  3>>> pd.DataFrame([a])   0  1  20  1  2  3

Viewing all articles
Browse latest Browse all 5

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>