<commit_before># -*- coding: utf-8 -*-

"""
This file is for random examples.
"""
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt

__author__ = '<NAME>', '<NAME>'
__email__ = '<EMAIL>', '<EMAIL>'


data = pd.read_csv(r'C:\Users\torkv\OneDrive - Norwegian University of Life '
                   r'Sciences\Documents\NMBU\master\ife\python\cellpy\utils'
                   r'\data\20160805_sic006_45_cc_01_ocvrlx_down.csv', sep=';')
df = pd.DataFrame(data)

# print df['time (s) cycle_no 1']
# print df[['time (s) cycle_no 1','time (s) cycle_no 2']]
# print np.array(df[['time (s) cycle_no 1','time (s) cycle_no 2']])

df2 = pd.DataFrame(np.array(df[['time (s) cycle_no 1','time (s) cycle_no 2']]))
print df2
# print df.head()
# print df.tail()
# print df.tail(2)


# ===============Data analysis with Pandas from youtube video, sentdex=========
# IO - input output
#If I want to export, then write: df.to_csv('new_name.csv')
# Renaming the coloumns

df3 = pd.read_csv(r'C:\Users\torkv\OneDrive - Norwegian University of Life '
                   r'Sciences\Documents\NMBU\master\ife\python\cellpy\utils'
                   r'\data\20160805_sic006_45_cc_01_ocvrlx_down.csv', sep=';')
df3.to_csv('new_csv.csv')
df3 = pd.read_csv('')<commit_msg>still trying to plot some basic ocv relaxation curves from the cell sic006_45_cc_01<commit_after># -*- coding: utf-8 -*-

"""
This file is for random examples.
"""
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt

__author__ = '<NAME>', '<NAME>'
__email__ = '<EMAIL>', '<EMAIL>'


data = pd.read_csv(r'C:\Users\torkv\OneDrive - Norwegian University of Life '
                   r'Sciences\Documents\NMBU\master\ife\python\cellpy\utils'
                   r'\data\20160805_sic006_45_cc_01_ocvrlx_down.csv',
                   sep=';', header=None)
df = pd.DataFrame(data[1:])
time_data = np.transpose(np.array(df.loc[:, :: 2]))
voltage_data = np.transpose(np.array(df.loc[:, 1::2]))

xy_data = {'time': [], 'voltage': []}
for time, volt in zip(time_data, voltage_data):
    xy_data['time'].append(time)
    xy_data['voltage'].append(volt)

xy_df = pd.DataFrame(xy_data)
print xy_df
xy_df['voltage'].plot()

# print df['time (s) cycle_no 1']
# print df[['time (s) cycle_no 1','time (s) cycle_no 2']]
# print np.array(df[['time (s) cycle_no 1','time (s) cycle_no 2']])

# df2 = pd.DataFrame(np.array(df[['time (s) cycle_no 1','time (s) cycle_no 2']]))
# print df2
# print df.head()
# print df.tail()
# print df.tail(2)


# ===============Data analysis with Pandas from youtube video, sentdex=========
# IO - input output
#If I want to export, then write: df.to_csv('new_name.csv')
# Renaming the coloumns

# df3 = pd.read_csv(r'C:\Users\torkv\OneDrive - Norwegian University of Life '
#                    r'Sciences\Documents\NMBU\master\ife\python\cellpy\utils'
#                    r'\data\20160805_sic006_45_cc_01_ocvrlx_down.csv', sep=';')
# df3.to_csv('new_csv.csv')
# df3 = pd.read_csv('new_csv.csv')
# # print df.head()
# df3.rename(columns={'time (s) cycle_no 1': 'time (s)'}, inplace=True)
# print df3.head()
{'fraction_non_alphanumeric': 0.18052869116698905, 'fraction_numerical': 0.03288201160541586, 'mean_word_length': 3.8183229813664594, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '573578', 'n_tokens_mistral': 1249, 'n_tokens_neox': 1151, 'n_words': 263}