Do you know what is the equivalent for javascript ? This is my code :
def sort_df(datas):
df_not_sorted = pd.read_json(StringIO(datas))
df_not_sorted["Date"] = df_not_sorted["Date"].apply(lambda dates: [datetime.fromisoformat(date.rstrip('Z')) for date in dates])
df_not_sorted["time"] = pd.to_datetime(df_not_sorted["time"])
df_not_sorted["time"] = df_not_sorted["time"].dt.tz_localize(None)
df = df_not_sorted.set_index(["Bus", "time"]).sort_index()
return df
You can use Danfo.js:
Danfo.js is heavily inspired by the Pandas library and provides a similar interface and API. This means users familiar with the Pandas API can easily use Danfo.js.
https://danfo.jsdata.org/
https://danfo.jsdata.org/getting-started
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With