'How to Create Pandas Dataframe from a complex List
I have the following result set from a query:
[{'192804': [{},
[(1652994300000, 590.0),
(1652994420000, 560.0),
(1652996220000, 560.0),
(1652996520000, 440.0),
(1652997000000, 180.0),
(1652997300000, 0.0)]]},
{'192805': [{},
[(1652995800000, 0.0),
(1652997600000, 0.0),
(1652999400000, 5.0),
(1653001200000, 5.0),
(1653003000000, 5.0),
(1653048000000, 5.0)]]}]
I would like to display the results in a pandas dataframe to look like the following:
'192804' '192805'
1652994300000 590
1652994420000 560
1652995800000 0
1652996220000 560
1652996520000 440
1652997000000 180
1652997300000 0
1652997600000 0
1652999400000 5
1653001200000 5
1653003000000 5
1653048000000 5
Would anyone know how to do that?
I have tried:
import pandas as pd
Data = [{'192804': [{},
[(1652994300000, 590.0),
... .... ...... .......
(1653048000000, 5.0)]]}]
df = pd.DataFrame(list(Data))
It gets me a result, but not the format I am striving for.
Solution 1:[1]
Hey Diego now there is react router v6
Where Switch is replaced for Routes and component={HomeScreen} for element={<HomeScreen/>}
import './App.css';
import Navbar from './components/Navbar';
import HomeScreen from './screens/HomeScreen'
import { BrowserRouter, Routes, Route} from 'react-router-dom'
function App() {
return (
<div className="App">
<Navbar/>
<BrowserRouter>
<Routes>
<Route path='/home' element={<HomeScreen/>} />
</Routes>
</BrowserRouter>
</div>
);
}
export default App;
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | S.Marx |
