question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't create a dataframe from a horizontal array?

See original GitHub issue

const arr = [200, 400, 600, 800, 1000, 1100, 1200, 1300, 1400, 1500, 1600, 1650, 1700, 1750, 1800, 1850, 1900, 1950, 2000, 2050, 2100, 2150, 2200, 2250, 2300, 2350, 2400, 2450, 2500, 2550, 2575, 2600, 2625, 2650, 2675, 2700, 2725, 2750, 2775, 2800, 2825, 2850, 2875, 2900, 2925, 2950, 2975, 3000, 3025, 3050, 3075, 3100, 3125, 3150, 3175, 3200, 3225, 3250, 3275, 3300, 3325, 3340, 3350, 3360, 3370, 3375, 3380, 3390, 3400, 3410, 3420, 3425, 3430, 3440, 3450, 3460, 3470, 3475, 3480, 3490, 3500, 3510, 3520, 3525, 3530, 3540, 3550, 3560, 3570, 3575, 3580, 3590, 3600, 3610, 3620, 3625, 3630, 3640, 3650, 3660, …]

const df = new dfd.DataFrame(arr, {columns: [‘A’]})

Uncaught Error: ParamError: Column names length mismatch. You provided a column of length 1 but Ndframe columns has lenght of undefined

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
risenWcommented, Mar 13, 2022

const arr = [200, 400, 600, 800, 1000, 1100, 1200, 1300, 1400, 1500, 1600, 1650, 1700, 1750, 1800, 1850, 1900, 1950, 2000, 2050, 2100, 2150, 2200, 2250, 2300, 2350, 2400, 2450, 2500, 2550, 2575, 2600, 2625, 2650, 2675, 2700, 2725, 2750, 2775, 2800, 2825, 2850, 2875, 2900, 2925, 2950, 2975, 3000, 3025, 3050, 3075, 3100, 3125, 3150, 3175, 3200, 3225, 3250, 3275, 3300, 3325, 3340, 3350, 3360, 3370, 3375, 3380, 3390, 3400, 3410, 3420, 3425, 3430, 3440, 3450, 3460, 3470, 3475, 3480, 3490, 3500, 3510, 3520, 3525, 3530, 3540, 3550, 3560, 3570, 3575, 3580, 3590, 3600, 3610, 3620, 3625, 3630, 3640, 3650, 3660,

This is definitely a bug, your initial code is supposed to work fine. I will fix this ASAP

1reaction
joshuakoh1commented, Mar 13, 2022

@risenW that still doesn’t solve the problem of it being a horizontal array for a single column

Uncaught Error: ParamError: Column names length mismatch. You provided a column of length 1 but Ndframe columns has lenght of 498

Edit: I managed to use dfd.tensorflow.transpose to flip it

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create pandas dataframe from numpy array - Stack Overflow
The answer is quite simple. Numpy stores arrays as row-vectors(!) and in the erroneous example you are passing two rows with 3 values...
Read more >
15 ways to create a Pandas DataFrame - Towards Data Science
Using DataFrame constructor pd.​​ The pandas DataFrame() constructor offers many different ways to create and initialize a dataframe. Method 4 — ...
Read more >
How To Create a Pandas Dataframe from a Dictionary
Create dataframe with Pandas DataFrame constructor​​ The dictionary below has two keys, scene and facade. Each value has an array of four ...
Read more >
How to add header row to a Pandas Dataframe?
We can create a data frame of specific number of rows and columns by first creating a multi -dimensional array and then converting...
Read more >
Combining Datasets: Concat and Append
def make_df(cols, ind): """Quickly make a DataFrame""" data = {c: [str(c) + ... and DataFrame objects is very similar to concatenation of Numpy...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found