score:33
Accepted answer
In [199]: df2.reset_index().to_dict(orient='list')
Out[199]:
{'date': ['2014-10-1', '2014-10-2', '2014-10-3', '2014-10-4', '2014-10-5'],
'foo': [8, 1, 8, 8, 1],
'temp': [10, 10, 8, 3, 10],
'time': [1, 2, 3, 4, 5]}
score:0
to create a list of the dictionaries per line
post_data_list = []
for i in df2.index:
data_dict = {}
for column in df2.columns:
data_dict[column] = df2[column][i]
post_data_list.append(data_dict)
Source: stackoverflow.com
Related Query
- Pandas data frame to dictionary of lists
- Formatting JSON from a Pandas data frame for Highcharts within a Django template
- Highcharts - Global configuration with common code and unique data & Headings
- Change color code on colum, depending on data value (highchartJS)
- Have an issue with JavaScript, AJAX code displaying data
- Convert pandas json for highstock data format in a angularjs controller
- creating lists based on JSON data
- Highcharts display label for pie chart using html table as data source
- Include additional highcharts source data in angular2 app
- Strange character in the Highstock source code
- Highcharts Data Parsing List of lists
- Highcharts series visibility with csv data source
- HTML table as data source for highstock charts using highcharts
- How do you convert time series data with pandas and show graph via highstock
- DotNet.HighCharts - PieChart by populating data by code
- Highcharts: reading data from a dictionary stored in a text file
- How to have multiple highcharts with different series data in vuejs without repeating code
- FusionCharts Failed to draw different chart on same data source
- Using a flask variable as data source for highcharts
- Error: Data source must be a URL for refresh | console error | javascript | Highcharts
- Highcharts cloud issue with data source when duplicating chart
- HighCharts Bubble graph JSON as data source
- Use HTML class as Highcharts table data source
- merge a few lists and regroup them into a dictionary to plot to multi-series Highcharts
- Use Node.js as data source for highcharts
- how do i link my sqlite(PDO) databse data to highcharts code
- HighChart.js data source recommendations
- How to render Gantt Highchart from data source
- I have no direct access to code but wonder if I can append my chart data points to a log file
- Highcharts - Pass a dictionary as data for a timeline series
More Query from same tag
- PhantomJS's limit for PNG generation with an Hightchart JSON document(3DOption enable)
- Setting Highcharts styledMode: true fails to load CSS
- Add label to column chart of Highchart
- Why does my addSeries (in highcharts) only display names of the series but not the actual pie chart itself
- Highcharts - Line Graph Marker Rendering Unreliable?
- Dynamically add an event to Highcharts series
- HighChart Chart displaying incorrect data when switched to StockChart
- Highcharts: Sort x-axis value from multiple CSV files
- Highstock navigator style / font
- Too long chart axis label title
- Highcharts Gauge styling and adding CSS elements
- Multiple labels in Highcharts Pie Graph
- Highcharts won't display data
- How do I change an individual bubble's color and opacity in HighCharts?
- Highchart how can i give frame like this?
- highchart line chart last null value is not conected with line
- Highcharts in the Rails Assest Pipeline not Loading
- highcharts not to fill the width
- Keeping x axis at bottom of highchart
- Synchronizing zoom between multiple charts
- How to position the navigator series in highstock?
- how to improve the efficacy while dynamic create charts
- Expand the range of the xAxis to show a specific number of points for live data
- Highcharts: cannot amend the histogram tooltip
- Highcharts datepicker - multiple series
- Highcharts - prevent pie chart from overlaping a line chart?
- Use django variable (array of elements from sqlite3 database) inside javascript embedded code
- Displaying multiple series in the navigator of an HighStock chart
- How to Change Legend Text of a Chart Object in Crystal Reports 10
- How do I change the opacity of a series in Highcharts?