class_docstr: A replay buffer that stores episodes of transitions. The additional structure allows performing various
  calculations of total return and other values that depend on the sequential behavior of the transitions
  in the episode.
class_docstr_tok: ["A","replay","buffer","that","stores","episodes","of","transitions",".","The","additional","structure","allows","performing","various","calculations","of","total","return","and","other","values","that","depend","on","the","sequential","behavior","of","the","transitions","in","the","episode","."]
docstr: Restore the replay buffer contents from a csv file.
  The csv file is assumed to include a list of transitions.
  :param csv_dataset: A construct which holds the dataset parameters
  :param input_filter: A filter used to filter the CSV data before feeding it to the memory.
code: def load_csv(
      self, csv_dataset: CsvDataset, input_filter: InputFilter
  ) -> None:
      """
      Restore the replay buffer contents from a csv file.
      The csv file is assumed to include a list of transitions.
      :param csv_dataset: A construct which holds the dataset parameters
      :param input_filter: A filter used to filter the CSV data before feeding it to the memory.
      """
      self.assert_not_frozen()
  
      df = pd.read_csv(csv_dataset.filepath)
      if len(df) > self.max_size[1]:
          screen.warning(
              "Warning! The number of transitions to load into the replay buffer ({}) is "
              "bigger than the max size of the replay buffer ({}). The excessive transitions will "
              "not be stored.".format(len(df), self.max_size[1])
          )
  
      episode_ids = df["episode_id"].unique()
      progress_bar = ProgressBar(len(episode_ids))
      state_columns = [
          col for col in df.columns if col.startswith("state_feature")
      ]
  
      for e_id in episode_ids:
          progress_bar.update(e_id)
          df_episode_transitions = df[df["episode_id"] == e_id]
          input_filter.reset()
  
          if len(df_episode_transitions) < 2:
              # we have to have at least 2 rows in each episode for creating a transition
              continue
  
          episode = Episode()
          transitions = []
          for (_, current_transition), (_, next_transition) in zip(
              df_episode_transitions[:-1].iterrows(),
              df_episode_transitions[1:].iterrows(),
          ):
              state = np.array(
                  [current_transition[col] for col in state_columns]
              )
              next_state = np.array(
                  [next_transition[col] for col in state_columns]
              )
  
              transitions.append(
                  Transition(
                      state={"observation": state},
                      action=int(current_transition["action"]),
                      reward=current_transition["reward"],
                      next_state={"observation": next_state},
                      game_over=False,
                      info={
                          "all_action_probabilities": ast.literal_eval(
                              current_transition[
                                  "all_action_probabilities"
                              ]
                          )
                      },
                  ),
              )
  
          transitions = input_filter.filter(
              transitions, deep_copy=False
          )
          for t in transitions:
              episode.insert(t)
  
          # Set the last transition to end the episode
          if csv_dataset.is_episodic:
              episode.get_last_transition().game_over = True
  
          self.store_episode(episode)
  
      # close the progress bar
      progress_bar.update(len(episode_ids))
      progress_bar.close()
  
imports: import ast
  import pickle
  from copy import deepcopy
  import math
  import pandas
  from typing import List, Tuple, Union
  import numpy
  import random
  from rl_coach.core_types import Transition, Episode
  from rl_coach.filters.filter import InputFilter
  from rl_coach.logger import screen
  from rl_coach.memories.memory import Memory, MemoryGranularity, MemoryParameters
  from rl_coach.utils import ReaderWriterLock, ProgressBar
  from rl_coach.core_types import CsvDataset
label_desc: Use image node_id 28 for calling the EpisodicExperienceReplay obj's underlying member method code with example usage: obj.load_csv(csv_dataset, input_filter) without return types