We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi there - is there an equivalent to https://pandas.pydata.org/docs/reference/api/pandas.melt.html for pivoting columns?
My csv looks like this:
id,name,type,2000-01-31,2000-02-29,2000-03-31,2000-04-30 102001,demo,test,70759,70760,70767,70815
I'd like the resulting dataframe to look like:
[ {id: 102001, name: 'demo', type: 'test', date: '2000-01-31', value: 70759}, {id: 102001, name: 'demo', type: 'test', date: '2000-02-29', value: 70760}, {id: 102001, name: 'demo', type: 'test', date: '2000-03-31', value: 70767}, {id: 102001, name: 'demo', type: 'test', date: '2000-04-30', value: 70815} ]
In pandas I'd write that as:
pd.melt(trends, id_vars =['id','name','type'], var_name='date', value_name='value' )
Not sure how active this project is, but hopefully this helps someone
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi there - is there an equivalent to https://pandas.pydata.org/docs/reference/api/pandas.melt.html for pivoting columns?
My csv looks like this:
I'd like the resulting dataframe to look like:
In pandas I'd write that as:
Not sure how active this project is, but hopefully this helps someone
The text was updated successfully, but these errors were encountered: